Production breaks on importing entire module
See original GitHub issueI am trying to import an entire module which has submodules.
When using aleph build
or aleph start
I get this error in the browser console:
Uncaught (in promise) TypeError: Cannot destructure property 'default' of '(intermediate value)' as it is undefined.
at deps.bundle.5a8741c5.js:1
at Generator.next (<anonymous>)
at e (deps.bundle.5a8741c5.js:1)
at i (deps.bundle.5a8741c5.js:1)
When using aleph dev
the code works as intended.
Example
The import is here (specifically the api
part):
https://gitlab.com/silk-matrix/silk-desktop/-/blob/aleph-issue-280/src/lib/useLogin.ts#L2
Using this code below has the same effect.
import * as api from "https://x.nest.land/matrix.ts@0.1.9/src/api/mod.ts";
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Modules is missing in production mode · Issue #7499 - GitHub
The problem really seems that it's being imported at all. I've disabled UglifyJsPlugin via the optimization portion of my webpack config: module ......
Read more >Why is Python running my module when I import it, and how ...
This module would just execute the main function when run, and not execute it if imported. It all depends on what you want...
Read more >Python import: Advanced Techniques and Tips
Organize imports into groups: first standard library imports, then third-party imports, and finally local application or library imports. Order imports ...
Read more >Traps for the Unwary in Python's Import System
While Python 3.3+ is able to import the submodule without any problems: ... long list is of all the methods of invocation that...
Read more >Modules: Packages | Node.js v19.3.0 Documentation
It treats all files that lack .json or .node extensions as JavaScript text ... Imported CommonJS modules have their URLs converted to absolute...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
alpha.30 can work fine in your example on macos
aleph.30 does fix it, not sure why it didn’t work from the master branch yesterday