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

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

Closed
yoursunny opened this issue Jul 5, 2020 · 8 comments
Closed

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

yoursunny opened this issue Jul 5, 2020 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@yoursunny
Copy link
Contributor

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.

yoursunny added a commit to yoursunny/NDNts that referenced this issue Jul 5, 2020
`npm run literate` is broken in Node v14.5 due to
K-FOSS/TS-ESNode#105
yoursunny added a commit to yoursunny/NDNts that referenced this issue Jul 5, 2020
`npm run literate` is broken in Node v14.5 due to
K-FOSS/TS-ESNode#105
@EntraptaJ
Copy link
Member

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

@EntraptaJ
Copy link
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.

@EntraptaJ
Copy link
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.

@EntraptaJ EntraptaJ self-assigned this Aug 5, 2020
@EntraptaJ EntraptaJ added the bug Something isn't working label Aug 5, 2020
@EntraptaJ
Copy link
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

@EntraptaJ
Copy link
Member

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

@yoursunny
Copy link
Contributor Author

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

@EntraptaJ
Copy link
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.

@EntraptaJ
Copy link
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
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants