Giter Site home page Giter Site logo

yarn2-pnp-exports-example's Introduction

Yarn 2 PNP module resolution does not honor proposal-pkg-exports

Relevant files

With Node >=12.7.0 and Yarn 1.21

Running:

rm .pnp.js
mv .yarnrc .yarnrc.bak
yarn install
yarn start

Will output:

(node:4780) ExperimentalWarning: The ESM module loader is experimental.
main.js executed.
other.js executed.

With Node >=12.7.0 and Yarn 2.0.0-rc

Running:

mv .yarnrc.bak .yarnrc
yarn install
yarn start

Will output:

index.js executed but should not have been.


Unable to load module "package-with-exports/sub/other"
Error: Couldn't find a suitable Node resolution for the specified unqualified path

Source path: /C:/Users/Franklin/Desktop/yarn-pnp-exports-example/packages/package-with-exports/sub/other
Rejected resolution: /C:/Users/Franklin/Desktop/yarn-pnp-exports-example/packages/package-with-exports/sub/other
Rejected resolution: /C:/Users/Franklin/Desktop/yarn-pnp-exports-example/packages/package-with-exports/sub/other.js
Rejected resolution: /C:/Users/Franklin/Desktop/yarn-pnp-exports-example/packages/package-with-exports/sub/other.json
Rejected resolution: /C:/Users/Franklin/Desktop/yarn-pnp-exports-example/packages/package-with-exports/sub/other.node
Rejected resolution: /C:/Users/Franklin/Desktop/yarn-pnp-exports-example/packages/package-with-exports/sub/other.mjs

Require stack:
- C:\Users\Franklin\Desktop\yarn-pnp-exports-example\index.js
    at internalTools_makeError (C:\Users\Franklin\Desktop\yarn-pnp-exports-example\.pnp.js:7832:24)
    at resolveUnqualified (C:\Users\Franklin\Desktop\yarn-pnp-exports-example\.pnp.js:8870:13)
    at resolveRequest (C:\Users\Franklin\Desktop\yarn-pnp-exports-example\.pnp.js:8895:14)
    at Object.resolveRequest (C:\Users\Franklin\Desktop\yarn-pnp-exports-example\.pnp.js:8985:26)
    at Function.external_module_default.a._resolveFilename (C:\Users\Franklin\Desktop\yarn-pnp-exports-example\.pnp.js:8046:29)
    at Function.external_module_default.a._load (C:\Users\Franklin\Desktop\yarn-pnp-exports-example\.pnp.js:7948:50)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (C:\Users\Franklin\Desktop\yarn-pnp-exports-example\index.js:10:5)
    at Module._compile (internal/modules/cjs/loader.js:956:30) {
  code: 'MODULE_NOT_FOUND',
  pnpCode: 'QUALIFIED_PATH_RESOLUTION_FAILED',
  data: {
    unqualifiedPath: '/C:/Users/Franklin/Desktop/yarn-pnp-exports-example/packages/package-with-exports/sub/other',
    request: 'package-with-exports/sub/other',
    issuer: '/C:/Users/Franklin/Desktop/yarn-pnp-exports-example/index.js'
  },
  requireStack: [
    'C:\\Users\\Franklin\\Desktop\\yarn-pnp-exports-example\\index.js'
  ]
}

yarn2-pnp-exports-example's People

Contributors

sparebytes avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.