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

Cannot use import statement outside a module #33

Open
konsumer opened this issue Jul 15, 2024 · 1 comment
Open

Cannot use import statement outside a module #33

konsumer opened this issue Jul 15, 2024 · 1 comment

Comments

@konsumer
Copy link

konsumer commented Jul 15, 2024

I think you need "type": "module" in your package.json.

When I import from a project that is setup this way, like this:

import fetchProgress from 'fetch-progress'

I get this:

/Users/konsumer/Desktop/videoexample/node_modules/fetch-progress/index.js:1
import Progress from './Progress';
^^^^^^

SyntaxError: Cannot use import statement outside a module
@dapize
Copy link

dapize commented Nov 29, 2024

I think you need "type": "module" in your package.json.

When I import from a project that is setup this way, like this:

import fetchProgress from 'fetch-progress'

I get this:

/Users/konsumer/Desktop/videoexample/node_modules/fetch-progress/index.js:1
import Progress from './Progress';
^^^^^^

SyntaxError: Cannot use import statement outside a module

https://stackoverflow.com/questions/58211880/uncaught-syntaxerror-cannot-use-import-statement-outside-a-module-when-import

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

2 participants