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

v7.4.1 breaks on ESM modules that use worker-threads #285

Closed
lehni opened this issue Mar 28, 2022 · 1 comment
Closed

v7.4.1 breaks on ESM modules that use worker-threads #285

lehni opened this issue Mar 28, 2022 · 1 comment

Comments

@lehni
Copy link
Contributor

lehni commented Mar 28, 2022

New version, new problem, new test-case :)

I also already have a fix coming up:

package.json

{
  "name": "node-dev-esm-worker-crash",
  "main": "index.js",
  "type": "module",
  "dependencies": {
    "node-dev": "^7.4.1",
    "pino": "^7.9.2",
    "pino-pretty": "^7.6.0"
  },
  "scripts": {
    "start": "node-dev index.js"
  }
}

index.js

import pino from 'pino'

const transport = pino.transport({ target: 'pino-pretty' })
const logger = pino({ level: 'info' }, transport)
logger.info('Hello world')

Run:

npm install
npm run start

Error:

TypeError: Path must be a string.
    at resolveSync (/Users/lehni/Development/Lineto/node-dev-crash/node_modules/resolve/lib/sync.js:75:15)
    at module.exports (/Users/lehni/Development/Lineto/node-dev-crash/node_modules/node-dev/lib/resolve-main.js:6:10)
    at getConfig (/Users/lehni/Development/Lineto/node-dev-crash/node_modules/node-dev/lib/cfg.js:33:16)
    at Object.<anonymous> (/Users/lehni/Development/Lineto/node-dev-crash/node_modules/node-dev/lib/wrap.js:12:34)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at Module._preloadModules (node:internal/modules/cjs/loader:1280:12)
Error: The worker thread exited
    at Worker.onWorkerExit (/Users/lehni/Development/Lineto/node-dev-crash/node_modules/thread-stream/index.js:180:32)
    at Worker.emit (node:events:526:28)
    at Worker.[kOnExit] (node:internal/worker:278:10)
    at Worker.<computed>.onexit (node:internal/worker:198:20)
[ERROR] 09:56:30 TypeError: Path must be a string.
[ERROR] 09:56:30 Error: The worker thread exited
lehni added a commit to lehni/node-dev that referenced this issue Mar 28, 2022
lehni added a commit to lehni/node-dev that referenced this issue Mar 28, 2022
@bjornstar
Copy link
Collaborator

This should be fixed in v7.4.2

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