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

SyntaxError: Unexpected token 'export' #23

Closed
5E7EN opened this issue Apr 8, 2022 · 2 comments
Closed

SyntaxError: Unexpected token 'export' #23

5E7EN opened this issue Apr 8, 2022 · 2 comments

Comments

@5E7EN
Copy link

5E7EN commented Apr 8, 2022

My typescript project fails to compile, spitting out the following error:

C:\...\node_modules\axios-cached-dns-resolve\index.js:1
export {
^^^^^^

SyntaxError: Unexpected token 'export'
    at wrapSafe (internal/modules/cjs/loader.js:1001:16)
    at Module._compile (internal/modules/cjs/loader.js:1049:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object.<anonymous> (C:\...\build\lib\helpers\network-manager.js:65:34)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)

From what I've seen in the past, this was a bug and has been resolved in past versions, however I am using v3.0.6 (latest as of writing), and still encounter this error.

Attempting to add "type": "module" to my package.json let to unexpected behavior, and isn't a solution for me either.

@tcollinsworth
Copy link
Owner

tcollinsworth commented Apr 8, 2022 via email

@tcollinsworth
Copy link
Owner

node -r esm ...
or
node -r esm-wallaby ...

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