Skip to content

Warning: The dynamicInstantiate loader hook has been removed. #105

Closed

Description

@yoursunny

dynamicInstantiate loader hook is gone since Node v14.5.0.
It causes warning:

Warning: The dynamicInstantiate loader hook has been removed.

For some code, including the test suite of this repository, it causes error:

RangeError [ERR_UNKNOWN_MODULE_FORMAT]: Unknown module format: dynamic
    at Loader.getModuleJob (internal/modules/esm/loader.js:236:13)
    at async ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:53:21)
    at async Promise.all (index 3)
    at async link (internal/modules/esm/module_job.js:58:9) {
  code: 'ERR_UNKNOWN_MODULE_FORMAT'
}

nodejs/node#33501 explains why they removed dynamicInstantiate.

Activity

  1. EntraptaJ commented on Jul 8, 2020

    @EntraptaJ
    Member

    Well, fuck. Any ideas how we can work around this while still supporting drop in compatibility with older libraries?

  2. EntraptaJ commented on Jul 8, 2020

    @EntraptaJ
    Member

    As happy as I am that I have to remove the hack, I don't know any other "easy" way of supporting external modules with fucky exports.

  3. EntraptaJ commented on Jul 8, 2020

    @EntraptaJ
    Member

    I just got deep into a server administration project for work, I might not be able to get to solving this quickly, I've been burned out from programming for a little bit, although I'd be happy to review, test, and merge a potential solution if anyone wants.

  4. self-assigned this
    on Aug 5, 2020
  5. EntraptaJ commented on Sep 15, 2020

    @EntraptaJ
    Member

    So, after taking a 3 month break from programming. I'm back, I almost have a fix for this. I can't get React SSR tests working, otherwise everything else is functional

  6. EntraptaJ commented on Sep 15, 2020

    @EntraptaJ
    Member

    Fix has been released. I haven't tested it in my projects yet. But all tests are passing.

  7. yoursunny commented on Sep 16, 2020

    @yoursunny
    ContributorAuthor

    It's working for me on Node 14.11.
    yoursunny/NDNts@65e493a

  8. EntraptaJ commented on Sep 16, 2020

    @EntraptaJ
    Member

    It's working for me on Node 14.11.
    yoursunny/NDNts@65e493a

    Awesome, sorry for the delay on fixing this one. Took a bit of a break from programming.

  9. EntraptaJ commented on Sep 16, 2020

    @EntraptaJ
    Member

    I also have it working in my new SSH-Proxy which is using the latest node:alpine3.12 image in the dev container. I haven't fully tested if @k-foss/ts-esnode=>1.7.0 works with node 14.4 and below, but the tests appear to be passing in Node.JS 13.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions