Skip to content

Production breaks on importing entire module #280

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

Closed
cyclane opened this issue Apr 16, 2021 · 7 comments
Closed

Production breaks on importing entire module #280

cyclane opened this issue Apr 16, 2021 · 7 comments
Labels
✘ bug Something isn't working

Comments

@cyclane
Copy link

cyclane commented Apr 16, 2021

I 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/[email protected]/src/api/mod.ts";
@ije
Copy link
Member

ije commented Apr 16, 2021

seems it's swc bundler issue like denoland/deno#9849, i am rewriting the bundler system using esbuild instead, that should work fine.
PR: #277

@cyclane
Copy link
Author

cyclane commented Apr 16, 2021

@ije I just tried using the master branch into which you have merged #277 and I am afraid I still get the same issue as well as a new error:

Uncaught TypeError: Cannot destructure property 'join' of '__ALEPH.pack.https://deno.land/[email protected]/path/mod.ts' as it is undefined.
    at login.bundle.009969a3.js:1
    at login.bundle.009969a3.js:43

@ije
Copy link
Member

ije commented Apr 16, 2021

deno 1.9?

@cyclane
Copy link
Author

cyclane commented Apr 17, 2021

Yes

@shadowtime2000 shadowtime2000 added the ✘ bug Something isn't working label Apr 17, 2021
ije pushed a commit that referenced this issue Apr 17, 2021
@ije
Copy link
Member

ije commented Apr 17, 2021

Screen Shot 2021-04-17 at 5 06 00 PM

fixed.

@ije
Copy link
Member

ije commented Apr 17, 2021

alpha.30 can work fine in your example on macos

@ije ije closed this as completed Apr 17, 2021
@cyclane
Copy link
Author

cyclane commented Apr 17, 2021

aleph.30 does fix it, not sure why it didn't work from the master branch yesterday

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✘ bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants