Skip to content

Compatibility with Yarn 2 (PnP) #36

Open
@mxro

Description

@mxro

Thanks for this useful library. I was wondering if this works together with Yarn 2 Plug'n'play (pnp)?

I am getting the following error:

 Command failed: node --unhandled-rejections=strict --abort-on-uncaught-exception "C:\Users\Max\repos\goldstack-mega\.yarn\$$virtual\svelte-jester-virtual-411df74ecf\0\cache\svelte-jester-npm-1.3.2-32d0fc490b-4f900c8d1a.zip\node_modules\svelte-jester\src\preprocess.js"
    Uncaught Error: Cannot find module 'C:\Users\Max\repos\goldstack-mega\.yarn\$$virtual\svelte-jester-virtual-411df74ecf\0\cache\svelte-jester-npm-1.3.2-32d0fc490b-4f900c8d1a.zip\node_modules\svelte-jester\src\preprocess.js'

    FROM

      at Object.process (../../../../.yarn/$$virtual/svelte-jester-virtual-411df74ecf/0/cache/svelte-jester-npm-1.3.2-32d0fc490b-4f900c8d1a.zip/node_modules/svelte-jester/src/transformer.js:16:30)

I assume this is caused by the following command in transformer.js#L16 not taking into account the Yarn PnP loader?

    const preprocessResult = execSync(
      `node --unhandled-rejections=strict --abort-on-uncaught-exception "${preprocessor}"`,
      {
        env: { PATH: process.env.PATH, source, filename, svelteConfig },
        maxBuffer: maxBuffer || 10 * 1024 * 1024,
      }
    ).toString();

Jest I think in other places automatically uses the PnP loader.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions