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

nested top level await dynamic imports broken #5215

Closed
cdaringe opened this issue May 10, 2020 · 5 comments
Closed

nested top level await dynamic imports broken #5215

cdaringe opened this issue May 10, 2020 · 5 comments
Labels
duplicate a duplicate of another issue

Comments

@cdaringe
Copy link
Contributor

cdaringe commented May 10, 2020

problem

nested dynamic imports aint workin!

error: Uncaught ReferenceError: x is not defined
b.x.uniq;
  ^
    at file:///Users/cdaringe/src/deno-nested-dynamic-import/a.ts:2:3

repro:

here are the tiny files for minimum repro:

// a.ts
const b = await import("./b.ts");
b.x.uniq;

// b.ts - broken
const uniq = await import("https://deno.land/x/lodash/uniq.js").then((mod) =>
  mod.default
);
export const x = { uniq };

// b.ts - ok
export const x = { uniq: 'this is fine' };

meta

npx envinfo


  System:
    OS: macOS 10.15.3
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Memory: 497.97 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 13.8.0 - ~/.nvm/versions/node/v13.8.0/bin/node
    Yarn: 1.12.3 - /usr/local/bin/yarn
    npm: 6.13.6 - ~/.nvm/versions/node/v13.8.0/bin/npm
  Managers:
    Cargo: 1.42.0 - ~/.cargo/bin/cargo
    Homebrew: 2.2.15 - /usr/local/bin/brew
    pip2: 9.0.1 - ~/.asdf/shims/pip2
    RubyGems: 3.0.3 - /usr/bin/gem
  Utilities:
    CMake: 3.13.0 - /usr/local/bin/cmake
    Make: 3.81 - /usr/bin/make
    GCC: 4.2.1 - /usr/bin/gcc
    Git: 2.19.0 - /usr/local/bin/git
    Clang: 1100.0.33.12 - /usr/bin/clang
    Subversion: 1.10.4 - /usr/bin/svn
    FFmpeg: 4.0.2 - /usr/local/bin/ffmpeg
  Servers:
    Apache: 2.4.41 - /usr/sbin/apachectl
  Virtualization:
    Docker: 19.03.8 - /usr/local/bin/docker
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
  IDEs:
    Nano: 2.0.6 - /usr/bin/nano
    VSCode: 1.45.0 - /usr/local/bin/code
    Vim: 8.1 - /usr/bin/vim
    Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
  Languages:
    Bash: 5.0.11 - /usr/local/bin/bash
    Go: 1.11.1 - /usr/local/bin/go
    Elixir: 1.9.1 - /usr/local/bin/elixir
    Java: javac 11 - /usr/bin/javac
    Perl: 5.18.4 - /usr/bin/perl
    PHP: 7.3.11 - /usr/bin/php
    Python: 2.7.14 - /Users/cdaringe/.asdf/shims/python
    Ruby: 2.6.3 - /usr/bin/ruby
    Rust: 1.21.1 - /Users/cdaringe/.cargo/bin/rustup
  Databases:
    SQLite: 3.28.0 - /usr/bin/sqlite3
  Browsers:
    Chrome: 81.0.4044.138
    Firefox: 73.0.1
    Safari: 13.0.5

:| Deno isn't listed ^ yet. deno 1.0.0-rc2

@kitsonk
Copy link
Contributor

kitsonk commented May 10, 2020

Need to look into how TLA works when exporting from a module according the v8 implementation and the spec.

For context, why are you doing what you are doing instead of:

import uniq from "https://deno.land/x/lodash/uniq.js";
export const x = { uniq };

@cdaringe
Copy link
Contributor Author

For context, why are you doing what you are doing instead of:

for example purposes only 😄

@cdaringe cdaringe changed the title nested dynamic imports broken nested top level await dynamic imports broken May 10, 2020
@nuxodin
Copy link

nuxodin commented May 11, 2020

That's something I stumbled upon, too.
Is that not possible according to the specifications?

@kitsonk
Copy link
Contributor

kitsonk commented May 11, 2020

I'm not sure yet. I think it is valid, but then I am not sure why it just doesn't work in Deno, as in theory we wouldn't be doing anything special here.

@bartlomieju bartlomieju added bug Something isn't working correctly deno_core Changes in "deno_core" crate are needed labels May 21, 2020
@kitsonk kitsonk added duplicate a duplicate of another issue and removed bug Something isn't working correctly deno_core Changes in "deno_core" crate are needed labels Sep 26, 2020
@kitsonk
Copy link
Contributor

kitsonk commented Sep 26, 2020

I know this came first, but #7649 is the same issue and there is work afoot to fix it but tied to that issue, so for clarity I am going to close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate a duplicate of another issue
Projects
None yet
Development

No branches or pull requests

4 participants