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

Bad pnpm fix makes using preact impossible #31551

Closed
JonathanWolfe opened this issue Nov 17, 2021 · 7 comments
Closed

Bad pnpm fix makes using preact impossible #31551

JonathanWolfe opened this issue Nov 17, 2021 · 7 comments
Labels
bug Issue was opened via the bug report template.

Comments

@JonathanWolfe
Copy link

What version of Next.js are you using?

12.0.4

What version of Node.js are you using?

14.18.1

What browser are you using?

Firefox

What operating system are you using?

macoS

How are you deploying your application?

next start

Describe the Bug

Error during webpack compile

❯ npm run dev

> marketing-next@0.1.0 dev
> next dev -p 8088

ready - started server on 0.0.0.0:8088, url: http://localhost:8088
Error: Cannot find module 'scheduler/package.json'
Require stack:
- /Users/jonwolfe/repos/marketing/app/node_modules/next/dist/build/webpack-config.js
- /Users/jonwolfe/repos/marketing/app/node_modules/next/dist/server/dev/hot-reloader.js
- /Users/jonwolfe/repos/marketing/app/node_modules/next/dist/server/dev/next-dev-server.js
- /Users/jonwolfe/repos/marketing/app/node_modules/next/dist/server/next.js
- /Users/jonwolfe/repos/marketing/app/node_modules/next/dist/server/lib/start-server.js
- /Users/jonwolfe/repos/marketing/app/node_modules/next/dist/cli/next-dev.js
- /Users/jonwolfe/repos/marketing/app/node_modules/next/dist/bin/next
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.mod._resolveFilename (/Users/jonwolfe/repos/marketing/app/node_modules/next/dist/build/webpack/require-hook.js:171:28)
    at Function.Module._resolveFilename (/Users/jonwolfe/repos/marketing/app/node_modules/module-alias/index.js:49:29)
    at Function.resolve (internal/modules/cjs/helpers.js:99:19)
    at getPackagePath (/Users/jonwolfe/repos/marketing/app/node_modules/next/dist/build/webpack-config.js:543:41)
    at Object.getBaseWebpackConfig [as default] (/Users/jonwolfe/repos/marketing/app/node_modules/next/dist/build/webpack-config.js:561:9)
    at async Promise.all (index 0)
    at async Span.traceAsyncFn (/Users/jonwolfe/repos/marketing/app/node_modules/next/dist/trace/trace.js:74:20)
    at async Span.traceAsyncFn (/Users/jonwolfe/repos/marketing/app/node_modules/next/dist/trace/trace.js:74:20)
    at async HotReloader.start (/Users/jonwolfe/repos/marketing/app/node_modules/next/dist/server/dev/hot-reloader.js:325:25) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/jonwolfe/repos/marketing/app/node_modules/next/dist/build/webpack-config.js',
    '/Users/jonwolfe/repos/marketing/app/node_modules/next/dist/server/dev/hot-reloader.js',
    '/Users/jonwolfe/repos/marketing/app/node_modules/next/dist/server/dev/next-dev-server.js',
    '/Users/jonwolfe/repos/marketing/app/node_modules/next/dist/server/next.js',
    '/Users/jonwolfe/repos/marketing/app/node_modules/next/dist/server/lib/start-server.js',
    '/Users/jonwolfe/repos/marketing/app/node_modules/next/dist/cli/next-dev.js',
    '/Users/jonwolfe/repos/marketing/app/node_modules/next/dist/bin/next'
  ]
}

caused by: a1e76fb

Needs try/catches added for error handling

Probably also causes #31538

Expected Behavior

next dev does not fail.

To Reproduce

package.json:

{
  "dependencies": {
    "next": "12.0.2",
    "next-plugin-preact": "^3.0.6",
    "preact": "^10.5.15",
    "preact-render-to-string": "^5.1.19",
    "preact-ssr-prepass": "^1.2.0",
    "react": "npm:@preact/compat@^17.0.3",
    "react-dom": "npm:@preact/compat@^17.0.3",
    "react-ssr-prepass": "npm:preact-ssr-prepass@^1.2.0",
  }
}

next.config.js:

const withPreact = require('next-plugin-preact');

/** @type { import('next').NextConfig } */;
const config = {
    reactStrictMode: true,
};

module.exports = withPreact(config);
@JonathanWolfe JonathanWolfe added the bug Issue was opened via the bug report template. label Nov 17, 2021
@Shashi-GS

This comment has been minimized.

@groenborg

This comment has been minimized.

@sentoxaio
Copy link

@JonathanWolfe were you able to fix this?

@JonathanWolfe
Copy link
Author

@JonathanWolfe were you able to fix this?

@sentoxaio No, I just set an exact version in my package.json to 12.0.3

@meck93
Copy link

meck93 commented Jan 12, 2022

@sentoxaio and @JonathanWolfe have you seen the temporary workaround: #31240 (comment)

I used npm i --save-dev scheduler and it works fine.

@balazsorban44
Copy link
Member

Duplicate of #31240

@balazsorban44 balazsorban44 marked this as a duplicate of #31240 Jan 23, 2022
@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants