Skip to content

I am using NextJS@14.1.4 (Pages router) and when I compile appear this error "Can't resolve 'next/dist/shared/lib/router-context'" #94

@Jacky16

Description

@Jacky16

I put this in webpack config on next.config

 webpack: (config) => {
    config.resolve.alias["next/dist/shared/lib/router-context$"] = path.join(
      __dirname,
      "node_modules",
      "next/dist/shared/lib/router-context.shared-runtime.js"
    );


    return config;
  },

The error in terminal:

Screenshot 2024-06-13 at 09 11 34

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions