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

Extensionsless "bin" scripts has conflict with Node --experimental-specifier-resolution option #39381

Closed
sosoba opened this issue Jul 2, 2020 · 1 comment
Labels
External Relates to another program, environment, or user action which we cannot control.

Comments

@sosoba
Copy link

sosoba commented Jul 2, 2020

TypeScript Version: 3.9.6

Search Terms:
experimental-specifier-resolution
extensinless
Code

package.json

{
  "name": "test",
  "devDependencies": {
    "typescript": "^3.9.6"
  },
  "scripts": {
    "test": "tsc -v"
  }
}

.npmrc

node-options="--experimental-specifier-resolution=node"
npm i
npm test

Expected behavior:

$ npm test
Version 3.9.6

Actual behavior:

$ npm test
(node:17248) ExperimentalWarning: The ESM module loader is experimental.
internal/modules/run_main.js:54
    internalBinding('errors').triggerUncaughtException(
                              ^

TypeError [ERR_INVALID_RETURN_PROPERTY_VALUE]: Expected string to be returned for the "format" from the "loader getFormat" function but got type object.
    at Loader.getFormat (internal/modules/esm/loader.js:122:13)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Loader.getModuleJob (internal/modules/esm/loader.js:244:20)
    at async Loader.import (internal/modules/esm/loader.js:178:17) {
  code: 'ERR_INVALID_RETURN_PROPERTY_VALUE'
}
npm ERR! Test failed.  See above for more details.

Related Issues:
nodejs/modules#488
nodejs/node#31415

This behaviour is the result of "extensionless" bin scripts:

    "bin": {
        "tsc": "./bin/tsc",
        "tsserver": "./bin/tsserver"
    },
@sosoba sosoba changed the title Extensionsless scripts has conflict with Node --experimental-specifier-resolution option Extensionsless "bin" scripts has conflict with Node --experimental-specifier-resolution option Jul 3, 2020
@RyanCavanaugh RyanCavanaugh added Infrastructure Issue relates to TypeScript team infrastructure External Relates to another program, environment, or user action which we cannot control. and removed Infrastructure Issue relates to TypeScript team infrastructure labels Jul 14, 2020
@typescript-bot
Copy link
Collaborator

This issue has been marked as 'External' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Relates to another program, environment, or user action which we cannot control.
Projects
None yet
Development

No branches or pull requests

3 participants