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
commonjs - Missing export (Error: ... is not exported by ...) #986
Comments
Seems to be resolved by #1038 |
There still seems to be the or at least a bug. In Short: I am importing a lib that depends on axios/axios. After updating to a version > 18 the import failed with
as mentioned here and in the related post here: #modernweb-dev/web#1700. Following the discussion(s) in #1038 and updating to v20.0.4 (beta), I get the following (new) error, though:
|
I'm in the same boat as @phihu - any advice or direction here would be much appreciated :) |
Anyone any success? |
v22.0.0 release and problem still exists try transforming to commonjs the |
I also am getting the same kind of error message with version 22.0.0 when trying to process
|
For anyone stuck at this problem: downgrading |
I'm having the same issue using vitejs when importing photoswipe. |
This comment was marked as duplicate.
This comment was marked as duplicate.
If anyone finds any additional solutions, please update the thread! I'm also facing the same issue and downgrading hasn't helped either. |
Also having issues with this. Using via web-test-runner. Downgrading to v21 just freezes web-test-runner, while latest release errors with |
I'm also having the same problem. v22 gives me the error about |
Same issue here with web-dev-server. v22 has the mentioned error and v21.1.0 just hangs: <--- Last few GCs ---> [8057:0x604c890] 384504 ms: Mark-sweep 2008.1 (2082.1) -> 1995.8 (2082.8) MB, 2674.3 / 0.0 ms (average mu = 0.178, current mu = 0.071) task scavenge might not succeed <--- JS stacktrace ---> FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory |
Same issue here with vitejs :
|
Any updates on this issue? v24.0.0 and still has issue. |
Same issue still with v24.0.1 Is this being addressed? |
I just tried this setting out and confirmed that it is still happening.
I am not using Vite, but I am am using Web Dev Server
<https://modern-web.dev/docs/dev-server/overview/> with Storybook, so I am
setting strict-requires on the plugin through that config.
The issue seems to be that I am using an ES Module ***@***.***/client-api)
which imports a commonjs library.
The imports are for "global/window.js", "core-js/ and "qs".
Everything works fine when I have commonjs plugin active and I don't import
the library I am having issues with.
…On Fri, Feb 3, 2023 at 12:41 AM Lukas Taegert-Atkinson < ***@***.***> wrote:
Did you try
build: {
commonjsOptions: {
strictRequires: true
}
}
in your Vite config?
—
Reply to this email directly, view it on GitHub
<#986 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFXK7EC6RL5O7CLBY6TLDWVTAC5ANCNFSM5DHI7CGQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I also have this issue using vite --version:
When i add
What am i missing? Any hints on investigating this? |
I am using Rollup to create an npm pacakge and I have the following versions:
I can see in the bundle file that the plugin adds the line A simplified
|
Trying out and adding some babel/rollup plugins:
I also got that kind of error:
Beginning of stack:
|
@cr4dle I also can't find the file |
how to resolve it ? |
how to resolve it ? |
Expected Behavior
Should correctly export whatever is imported.
Actual Behavior
Weird and irrelevant export.
The piece of code (
importDeclaration.module.info.code
) that fails looks like this:@lukastaegert this looks like it's originating from the latest refactor during the circular dependencies support. While
mongodb
cannot be rolled up normally as it has severe circular dependencies, it seems to not be able to be rolled up dynamically too due to this bug. It looks like this should have been a reexport of__exports
or at least*
.I tried to look into this and have not found what causes this to compose in such a way.
It's probably line 228 in index.js, but how do we make it play well with the other stuff that's being shoved in there?
The text was updated successfully, but these errors were encountered: