question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bad pnpm fix makes using preact impossible

See original GitHub issue

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: a1e76fb96678b0ac3d7a74c28d2d005516ef1cc0

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);

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
Shashi-GScommented, Jan 11, 2022

I am also facing the same issue.

0reactions
github-actions[bot]commented, Feb 23, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pnpm/pnpm - Gitter
Hey, is there anyway to use pnpmfile.js in conjunction with shared-workspace-lockfile=false at the root of my workspace and have it use the pnpmfile.js...
Read more >
Uncaught Error: Cannot find module 'react/jsx-runtime'
I tried adding it the .js back to webpack's resolve.extensions and the error disappeared. In hindsight I guess this make senses.
Read more >
State of JavaScript 2021 | Hacker News
Finally, jeez, angular isn't that bad. Plenty of enterprises use it successfully, and for companies with .NET or Java stacks, it's a great...
Read more >
@quilted/react-testing | Yarn - Package Manager
A library for testing React components with a focus on type safety and clear component boundaries. Table of contents. Installation; Usage. DOM; Preact;...
Read more >
nextjs a client-side exception has occurred - You.com | The Search ...
The lack of a readable source code is making this impossible for me to understand what's ... The above code configuration has fixed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found