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

esmocha broken by ESM hook changes? #1029

Closed
targos opened this issue Nov 21, 2023 · 3 comments
Closed

esmocha broken by ESM hook changes? #1029

targos opened this issue Nov 21, 2023 · 3 comments

Comments

@targos
Copy link
Member

targos commented Nov 21, 2023

See https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/3346/nodes=fedora-latest-x64/testReport/junit/(root)/citgm/yeoman_generator_v7_1_1/

 (node:2432990) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
 --import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("file%3A///home/iojs/tmp/citgm_tmp/4ed0215e-d955-4a5a-9009-ef6a213716ab/yeoman-generator/node_modules/esmocha/dist/loader.js", pathToFileURL("./"));'
 (Use `node --trace-warnings ...` to show where the warning was created)
 (node:2432990) ExperimentalWarning: `globalPreload` is planned for removal in favor of `initialize`. `globalPreload` is an experimental feature and might change at any time
 (Use `node --trace-warnings ...` to show where the warning was created)
 TypeError [ERR_INVALID_RETURN_PROPERTY_VALUE]: Expected array buffer, or typed array to be returned for the "source" from the "transformSource" function but got null.
     at assertBufferSource (node:internal/modules/esm/translators:104:9)
     at stringify (node:internal/modules/esm/translators:119:3)
     at createCJSModuleWrap (node:internal/modules/esm/translators:279:12)
     at ModuleLoader.commonjsStrategy (node:internal/modules/esm/translators:358:10)
     at callTranslator (node:internal/modules/esm/loader:285:14)
     at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:291:30)

@mshima
@nodejs/loaders

@aduh95
Copy link

aduh95 commented Nov 21, 2023

Hopefully nodejs/node#50825 should address this.

@mshima
Copy link

mshima commented Nov 21, 2023

Is esmocha used to test a yeoman-generator fork only?
Fixing that node behavior is not enough fix tests.
The main problem is the mocking lib that needs major changes due to loader/main thread communication.
I plan to fix esmocha, but for yeoman-generator migrate to vitest is the best option.

@targos
Copy link
Member Author

targos commented Nov 24, 2023

Error disappeared with nodejs/node#50825.

@targos targos closed this as completed Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants