Skip to content

[bug] React component failed to build with Next.js 12 #782

@TechQuery

Description

@TechQuery

@giscus

What happened?

When I update giscus-react from 2.2.2 to 2.2.3, Next.js 12 building crashed with an error:

info  - Collecting page data .Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'D:\Work\Community\KaiYuanShe\OWS\node_modules\.pnpm\@[email protected]_sfoxds7t5ydpegc3knd667wn6m\node_modules\react\jsx-runtime' imported from D:\Work\Community\KaiYuanShe\OWS\node_modules\.pnpm\@[email protected]_sfoxds7t5ydpegc3knd667wn6m\node_modules\@giscus\react\dist\index.mjs    
Did you mean to import [email protected]/node_modules/react/jsx-runtime.js?
    at new NodeError (node:internal/errors:387:5)
    at finalizeResolution (node:internal/modules/esm/resolve:330:11)
    at moduleResolve (node:internal/modules/esm/resolve:907:10)
    at defaultResolve (node:internal/modules/esm/resolve:1115:11)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:837:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
    at link (node:internal/modules/esm/module_job:75:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

> Build error occurred
Error: Failed to collect page data for /article/[id]
    at D:\Work\Community\KaiYuanShe\OWS\node_modules\.pnpm\[email protected]_sfoxds7t5ydpegc3knd667wn6m\node_modules\next\dist\build\utils.js:916:15 {
  type: 'Error'
}

Environment

Software Version(s)
React 17.0.2
Next.js 12.3.3
Node 16.18.0
PNPM 7.15.0
Operating System Windows 10 Pro 21H2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions