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

theres a bug with node17 + uvu + experimental loader #163

Closed
noahehall opened this issue Nov 19, 2021 · 4 comments
Closed

theres a bug with node17 + uvu + experimental loader #163

noahehall opened this issue Nov 19, 2021 · 4 comments

Comments

@noahehall
Copy link

noahehall commented Nov 19, 2021

context:

  • using node17 experimental loader to automatically remove type annotations from javascript files
  • fyi: works with node16
  • when running the experimental loader through uvu on node17: fails

theres a lot of stuff here, but of importance is this line

(node:611146) WARNING: Exited the environment with code 1
    at exit (node:internal/process/per_thread:189:13)
    at /home/poop/git/foss/nodeproto/node_modules/.pnpm/uvu@0.5.2/node_modules/uvu/bin.js:32:12

log

poop@spaceship:~/git/foss/nodeproto/packages/libraries/buildproto
07:38 AM (shiz-broken $=) 
$ pnpm repo:test

> @nodeproto/buildproto@0.0.0 repo:test /home/poop/git/foss/nodeproto/packages/libraries/buildproto
> NODE_OPTIONS="$npm_package_config_NODE_OPTIONS" uvu ./src "test.(m|c)?js"

(node:611146) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
    at emitExperimentalWarning (node:internal/util:224:11)
    at initializeLoader (node:internal/process/esm_loader:59:3)
    at loadESM (node:internal/process/esm_loader:87:11)
    at runMainESM (node:internal/modules/run_main:48:21)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:78:5)
    at node:internal/main/run_main_module:17:47


 custom logic {
  url: 'file:///home/poop/git/foss/nodeproto/packages/libraries/buildproto/src/esbuild/create.esbuild.config.test.mjs',
  isCjs: false,
  isFlow: false
}
TypeError [ERR_INVALID_FILE_URL_HOST]: File URL host must be "localhost" or empty on linux
    at __node_internal_captureLargerStackTrace (node:internal/errors:464:5)
    at new NodeError (node:internal/errors:371:5)
    at getPathFromURLPosix (node:internal/url:1449:11)
    at fileURLToPath (node:internal/url:1472:50)
    at toPathIfFileURL (node:internal/url:1551:10)
    at __node_internal_ (node:internal/fs/utils:681:16)
    at statSync (node:fs:1529:10)
    at fileExists (node:internal/modules/esm/resolve:260:10)
    at resolveExtensions (node:internal/modules/esm/resolve:335:9)
    at resolveExtensionsWithTryExactName (node:internal/modules/esm/resolve:322:10)
    at finalizeResolution (node:internal/modules/esm/resolve:375:16)
    at moduleResolve (node:internal/modules/esm/resolve:915:10)
    at defaultResolve (node:internal/modules/esm/resolve:1005:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:475:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:245:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:79:40)
    at link (node:internal/modules/esm/module_job:78:36)
(node:611146) WARNING: Exited the environment with code 1
    at exit (node:internal/process/per_thread:189:13)
    at /home/poop/git/foss/nodeproto/node_modules/.pnpm/uvu@0.5.2/node_modules/uvu/bin.js:32:12
 ELIFECYCLE  Command failed with exit code 1.
@noahehall
Copy link
Author

noahehall commented Nov 19, 2021

will include more details later, but i need to go to work

environment

poop@spaceship:~/git/foss/nodeproto/packages/libraries/buildproto
07:40 AM (shiz-broken $=) 
$ pnpm repo:about

> @nodeproto/buildproto@0.0.0 repo:about /home/poop/git/foss/nodeproto/packages/libraries/buildproto
> npm run-script && npm --versions && pnpm -r config list --json t && echo "NODE OPTIONS set to: $npm_package_config_NODE_OPTIONS"

npm info using npm@8.1.2
npm info using node@v17.1.0
npm timing npm:load:whichnode Completed in 0ms
npm timing config:load:defaults Completed in 1ms
npm timing config:load:file:/home/poop/.local/share/pnpm/nodejs/17.1.0/lib/node_modules/npm/npmrc Completed in 2ms
npm timing config:load:builtin Completed in 2ms
npm timing config:load:cli Completed in 1ms
npm timing config:load:env Completed in 2ms
npm timing config:load:file:/home/poop/git/foss/nodeproto/packages/libraries/buildproto/.npmrc Completed in 0ms
npm timing config:load:project Completed in 0ms
npm timing config:load:file:/home/poop/.npmrc Completed in 0ms
npm timing config:load:user Completed in 0ms
npm timing config:load:file:/home/poop/.config/pnpm/npmrc Completed in 0ms
npm timing config:load:global Completed in 0ms
npm timing config:load:validate Completed in 1ms
npm timing config:load:credentials Completed in 1ms
npm timing config:load:setEnvs Completed in 1ms
npm timing config:load Completed in 10ms
npm timing npm:load:configload Completed in 10ms
npm timing npm:load:setTitle Completed in 0ms
npm timing npm:load:setupLog Completed in 0ms
npm timing config:load:flatten Completed in 2ms
npm timing npm:load:cleanupLog Completed in 2ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load:projectScope Completed in 1ms
npm timing npm:load Completed in 19ms
Scripts available in @nodeproto/buildproto@0.0.0 via `npm run-script`:
  build
    pnpm cjs:swc
  build:debug
    pnpm cjs:swc:debug
  cjs:babel
    clear; pnpm repo:rm:dist && NODE_OPTIONS=$npm_package_config_NODE_OPTIONS babel $npm_package_config_DIRS_TO_TRANSPILE -d $npm_package_config_PATH_DIST --out-file-extension .js --ignore 'src/**/*.test.mjs' --ignore src/webpack/test.compiler.mjs
  cjs:swc
    pnpm clean && NODE_OPTIONS="$npm_package_config_NODE_OPTIONS" swc $npm_package_config_DIRS_TO_TRANSPILE -d $npm_package_config_PATH_DIST --config-file ./node_modules/@nodeproto/configproto/src/swc/node.swcrc --copy-files
  cjs:swc:debug
    pnpm cjs:swc -- --sync
  clean
    pnpm repo:rm:dist && pnpm repo:cp:cjs
  js:to:cjs
    for f in ./dist/**/*.js; do mv -- "$f" "${f%.js}.cjs"; done
  proto
    pnpm exec ultra -r
  proto:bin
    pnpm -r exec $*
  proto:script
    NODE_OPTIONS="$npm_package_config_NODE_OPTIONS" pnpm -r $*
  proto:slice
    NODE_OPTIONS="$npm_package_config_NODE_OPTIONS" pnpm exec ultra -r --filter
  repo:about
    npm run-script && npm --versions && pnpm -r config list --json t && echo "NODE OPTIONS set to: $npm_package_config_NODE_OPTIONS"
  repo:about:scripts
    npm run-script
  repo:cp:browserslist
    rm -f .browserslistrc && cp ./node_modules/@nodeproto/configproto/.browserslistrc .
  repo:cp:cjs
    rm -f ./dist/package.json && mkdir -p dist && cp ./node_modules/@nodeproto/configproto/src/node/cjs.json ./dist/package.json
  repo:cp:configproto
    pnpm repo:cp:flow; pnpm repo:cp:cjs; pnpm repo:cp:browserslist
  repo:cp:flow
    rm -f .flowconfig && cp ./node_modules/@nodeproto/configproto/.flowconfig .
  repo:deps
    ultra --info
  repo:eslint
    eslint './**/*'
  repo:eslint:fix
    pnpm repo:eslint -- --fix
  repo:flowtyped:install
    flow-typed install
  repo:jsync
    jsync
  repo:monitor
    ultra --monitor
  repo:nuke
    pnpm repo:rm:dist; pnpm repo:rm:nodemodules
  repo:rm:dist
    rm -rf dist/*
  repo:rm:nodemodules
    rm -rf node_modules/*
  repo:scripts
    ultra --list
  repo:scripts:v
    npm run-script
  repo:test
    NODE_OPTIONS="$npm_package_config_NODE_OPTIONS" uvu ./src "test.(m|c)?js"
  repo:test:file
    NODE_OPTIONS="$npm_package_config_NODE_OPTIONS" node $*
  repo:test:help
    uvu --help
  repo:testing
    pnpm repo:test; chokidar "src/**/*(?:.test)?.(m|c)?js" -c "pnpm repo:test"

npm timing command:run-script Completed in 6ms
npm timing npm Completed in 116ms
npm info ok 
npm info using npm@8.1.2
npm info using node@v17.1.0
npm timing npm:load:whichnode Completed in 0ms
npm timing config:load:defaults Completed in 1ms
npm timing config:load:file:/home/poop/.local/share/pnpm/nodejs/17.1.0/lib/node_modules/npm/npmrc Completed in 2ms
npm timing config:load:builtin Completed in 2ms
npm timing config:load:cli Completed in 2ms
npm timing config:load:env Completed in 1ms
npm timing config:load:file:/home/poop/git/foss/nodeproto/packages/libraries/buildproto/.npmrc Completed in 1ms
npm timing config:load:project Completed in 1ms
npm timing config:load:file:/home/poop/.npmrc Completed in 0ms
npm timing config:load:user Completed in 0ms
npm timing config:load:file:/home/poop/.config/pnpm/npmrc Completed in 0ms
npm timing config:load:global Completed in 0ms
npm timing config:load:validate Completed in 1ms
npm timing config:load:credentials Completed in 1ms
npm timing config:load:setEnvs Completed in 1ms
npm timing config:load Completed in 10ms
npm timing npm:load:configload Completed in 10ms
npm timing npm:load:setTitle Completed in 0ms
npm timing npm:load:setupLog Completed in 0ms
npm timing config:load:flatten Completed in 2ms
npm timing npm:load:cleanupLog Completed in 2ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load:projectScope Completed in 1ms
npm timing npm:load Completed in 19ms
npm timing config:load:flatten Completed in 0ms
{
  '@nodeproto/buildproto': '0.0.0',
  npm: '8.1.2',
  node: '17.1.0',
  v8: '9.5.172.25-node.13',
  uv: '1.42.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.18.1',
  modules: '102',
  nghttp2: '1.45.1',
  napi: '8',
  llhttp: '6.0.4',
  openssl: '3.0.0+quic',
  cldr: '39.0',
  icu: '69.1',
  tz: '2021a',
  unicode: '13.0',
  ngtcp2: '0.1.0-DEV',
  nghttp3: '0.1.0-DEV'
}
npm timing command:version Completed in 4ms
npm timing npm Completed in 114ms
npm info ok 
NODE OPTIONS set to: --abort-on-uncaught-exception --diagnostic-dir="/var/.nodeproto/diagnostics" --enable-source-maps --experimental-abortcontroller --experimental-modules --experimental-import-meta-resolve --experimental-json-modules --experimental-loader="./node_modules/@nodeproto/configproto/src/node/loaders/flow.mjs" --experimental-specifier-resolution=node --experimental-top-level-await --experimental-vm-modules --pending-deprecation --report-compact --report-dir="/var/.nodeproto/reports" --report-filename=nodeprotolog --report-on-fatalerror --report-on-signal --report-signal=SIGUSR2 --report-uncaught-exception --trace-deprecation --trace-exit --trace-sigint --trace-uncaught --trace-warnings --unhandled-rejections=throw --use-largepages=on --zero-fill-buffers --preserve-symlinks-main

poop@spaceship:~/git/foss/nodeproto/packages/libraries/buildproto
07:42 AM (shiz-broken $=) 

@lukeed
Copy link
Owner

lukeed commented Nov 19, 2021

I have zero idea what's going on here. Going to need more information – but likely a reproduction – to stand a chance at helping you out.

My gut impression is that this is an issue with your experimental loader (whatever it is, dunno) and it's only surfacing as an error / caught by uvu.

@noahehall
Copy link
Author

you are exactly right my friend - just figured it out

@noahehall
Copy link
Author

just FYI

nodejs/node#41320

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

2 participants