Skip to content

ESM: working on 10.15.2, fails on 10.15.3?Β #27846

Description

@patrikbeno
  • Version: 10.15.3
  • Platform: Docker: node:10.15.3-alpine
  • Subsystem: ES modules

Working on 10.15.2:

FROM node:10.15.2-alpine as esm_working
WORKDIR /bugcheck
RUN npm init -y
RUN npm i request request-promise
RUN echo "import request from 'request-promise'" > bugcheck.mjs
RUN node --experimental-modules bugcheck.mjs

Failing on 10.15.3:

FROM node:10.15.3-alpine as esm_failing
WORKDIR /bugcheck
RUN npm init -y
RUN npm i request request-promise
RUN echo "import request from 'request-promise'" > bugcheck.mjs
RUN node --experimental-modules bugcheck.mjs

Error: request-promise is trying to load request library but fails:

TypeError: Cannot read property 'onReady' of undefined
    at Module.load (internal/modules/cjs/loader.js:611:22)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/bugcheck/node_modules/psl/index.js:14:19)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/bugcheck/node_modules/tough-cookie/lib/pubsuffix-psl.js:32:11)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/bugcheck/node_modules/tough-cookie/lib/cookie.js:35:17)

What has changed?
Was that intentional or is it a regression?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    esmIssues and PRs related to the ECMAScript Modules implementation.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions