Skip to content

Unable to install - ERR_PACKAGE_PATH_NOT_EXPORTED #66

@neverstew

Description

@neverstew

Summary

The plugin doesn't work with a fresh create-next-app install (anymore).

Reproduction

Minimal Reproduction

I've tested this both in StackBlitz and locally (Ubuntu 20). The steps are as you might expect:

  • Follow the nextjs install guide (run create-next-app)
  • Follow this plugin install guide

Error

➜  nextjs-preact git:(main) ✗ npm run dev

> nextjs-preact@0.1.0 dev
> next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './compat/server.browser' is not defined by "exports" in /home/matt/dev/experiments/nextjs-preact/node_modules/preact/package.json
    at new NodeError (node:internal/errors:371:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:429:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:683:3)
    at resolveExports (node:internal/modules/cjs/loader:482:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.mod._resolveFilename (/home/matt/dev/experiments/nextjs-preact/node_modules/next/dist/build/webpack/require-hook.js:23:32)
    at Function.Module._resolveFilename (/home/matt/dev/experiments/nextjs-preact/node_modules/module-alias/index.js:49:29)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:999:19) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Notes

This might be similar to #52
I don't think this is related to #55

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