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

V2: Webpack + @mdx-js/loader not playing well with Yarn 2-3's PnP #1922

Closed
4 tasks done
tavoyne opened this issue Jan 29, 2022 · 2 comments
Closed
4 tasks done

V2: Webpack + @mdx-js/loader not playing well with Yarn 2-3's PnP #1922

tavoyne opened this issue Jan 29, 2022 · 2 comments
Labels
👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on

Comments

@tavoyne
Copy link

tavoyne commented Jan 29, 2022

Initial checklist

Affected packages and versions

@mdx-js/loader@2.0.0-rc.2

Link to runnable example

No response

Steps to reproduce

Clone this repository (it's a minimal example).

Run yarn webpack.

Expected behavior

Compilation should be successful.

Actual behavior

I get the following error message:

node:internal/errors:464
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/blackjelly/code/mdx-pb/.yarn/__virtual__/@mdx-js-loader-virtual-079d9df3b5/0/cache/@mdx-js-loader-npm-2.0.0-rc.2-eb4487e27d-5637b8d92c.zip/node_modules/@mdx-js/loader/lib/index.js' imported from /Users/blackjelly/code/mdx-pb/.yarn/__virtual__/@mdx-js-loader-virtual-079d9df3b5/0/cache/@mdx-js-loader-npm-2.0.0-rc.2-eb4487e27d-5637b8d92c.zip/node_modules/@mdx-js/loader/index.cjs

If I disable PnP, i.e. if I set nodeLinker: node-modules in .yarnrc.yml, then it compiles.

I believe it has to do with the dynamic import of an ES module in the package's entry point.

I'd be happy to make a PR if anybody has an idea of how to fix that.

Runtime

Node v16

Package manager

yarn v2

OS

macOS

Build and bundle tools

webpack

@wooorm
Copy link
Member

wooorm commented Jan 29, 2022

This should be reported with Yarn. Because those files are published: https://unpkg.com/browse/@mdx-js/loader@2.0.0-rc.2/

@wooorm wooorm closed this as completed Jan 29, 2022
@wooorm wooorm added 👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on labels Jan 29, 2022
@kidonng
Copy link

kidonng commented Feb 7, 2022

For reference: yarnpkg/berry#4034

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

3 participants