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

Compilation Error: Module parse failed with Unexpected Character in Version 0.36.1 #1113

Closed
Froelund opened this issue Sep 3, 2023 · 1 comment

Comments

@Froelund
Copy link

Froelund commented Sep 3, 2023

I am using ncc version 0.36.1 and encountering an issue while compiling an ssr.js file into ESM format. The error message suggests that a module parse failed due to an unexpected character. The error also hints that an additional loader might be needed.

Environment:
ncc version: 0.36.1
Node.js version: (please specify)
Operating System: (please specify)

Steps to Reproduce:

In my code, I use leaflet("@vue-leaflet/vue-leaflet": "^0.10.1",). When I comment out the leaflet peace, everything is fine.

Run npx --yes @vercel/ncc build -t bootstrap/ssr/ssr.js --out=bootstrap/sidecar-ssr

Observe the error
Error Message:

ncc: Version 0.36.1
ncc: Compiling file index.js into ESM
Error: Module parse failed: Unexpected character '�' (1:0)
File was processed with these loaders:
 * ../../../.npm/_npx/7a71fb44c9115061/node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js
You may need an additional loader to handle the result of these loaders.
(Source code omitted for this binary file)
Module parse failed: Unexpected character '�' (1:0)
File was processed with these loaders:
 * ../../../.npm/_npx/7a71fb44c9115061/node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js
You may need an additional loader to handle the result of these loaders.
(Source code omitted for this binary file)
Module parse failed: Unexpected character '�' (1:0)
File was processed with these loaders:
 * ../../../.npm/_npx/7a71fb44c9115061/node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js
You may need an additional loader to handle the result of these loaders.
(Source code omitted for this binary file)
    at /Users/<me>/.npm/_npx/7a71fb44c9115061/node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:37:1870077
    at /Users/<me>/.npm/_npx/7a71fb44c9115061/node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:37:383620
    at _done (eval at create (/Users/<me>/.npm/_npx/7a71fb44c9115061/node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:20:75523), <anonymous>:9:1)
    at eval (eval at create (/Users/<me>/.npm/_npx/7a71fb44c9115061/node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:20:75523), <anonymous>:34:22)

Would appreciate any guidance on how to resolve this issue. Thank you!

@styfle
Copy link
Member

styfle commented Sep 6, 2023

This looks like a duplicate of #776

@styfle styfle closed this as not planned Won't fix, can't repro, duplicate, stale Sep 6, 2023
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