-
Notifications
You must be signed in to change notification settings - Fork 21
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: Identifier '__filename' has already been declared #150
Comments
My workaround is just to remove these 3 lines from both packages:
None of these 3 const is used anywhere below, so these patches were OK. Renaming I think |
Hi @bashmish, thanks for the report! It seems that the problem is due to the fact that the packages are meant to be used as ESM modules. However, actually those variables are not used in the distribution files, so we have removed them in this PR. We hope it will solve the problem. Alternatively, we will consider distributing the package in the two formats. |
@edoardocavazza thanks for a quick fix! Indeed I use it in the CommonJS module. Looking forward to the release and gonna test it right away. |
I'm using the esbuild plugin
@chialab/esbuild-plugin-commonjs
to transpile named exports from CJS to EMS, the esbuild config is pretty much the following (but you can find all details in bashmish/storybook-builder-wds#2):I run into the issue with the following syntax:
found in 2 package:
node_modules/@chialab/estransform/dist/index.js
lines 4-5-6 in https://cdn.jsdelivr.net/npm/@chialab/estransform@0.17.3/dist/index.js
node_modules/@chialab/node-resolve/dist/index.js
lines 4-5-6 in https://cdn.jsdelivr.net/npm/@chialab/node-resolve@0.17.0/dist/index.js
resulting in the following error:
The text was updated successfully, but these errors were encountered: