Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to import into ES6 yields error #821

Closed
jauntyjocularjay opened this issue Mar 18, 2024 · 6 comments
Closed

Attempting to import into ES6 yields error #821

jauntyjocularjay opened this issue Mar 18, 2024 · 6 comments

Comments

@jauntyjocularjay
Copy link

Expected behavior:

Import dotenv using the instructions in the readme.md

Actual Behavior:

import 'dotenv/config'

Yields an error in Chrome

Uncaught TypeError: Failed to resolve module specifier "dotenv/config". Relative references must start with either "/", "./", or "../".

notes:

Error files: I have preserved the error in a branch of my project.
IDE: VSCode
Browser: Chrome Version 122.0.6261.129 (Official Build) (64-bit)
OS: Windows 10

@motdotla
Copy link
Owner

does this format work for you:

import { config } from "dotenv";
config();

@motdotla
Copy link
Owner

see this thread: #89 (comment)

@jauntyjocularjay
Copy link
Author

Interesting, I am not using nextjs to my knowledge, unless Phaser uses that under the hood.

@jauntyjocularjay
Copy link
Author

does this format work for you:

import { config } from "dotenv";
config();

Same result.

Console:

Uncaught TypeError: Failed to resolve module specifier "dotenv". Relative references must start with either "/", "./", or "../".

@jauntyjocularjay
Copy link
Author

It doesn't look like Phaser uses NextJS under the hood. I don't have a next.config.js file to modify.

@jonjieviduya
Copy link

I still get "process not defined"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants