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

Error - Package subpath ./package.json is not defined by exports in package.json #24

Open
Kekananen opened this issue Jan 18, 2023 · 1 comment

Comments

@Kekananen
Copy link
Contributor

There is an error in running yarn dev when freshly installing this on MacOS Monterey v12.6. Resolved it following via solution purposed in issue 444 in the uuid repository. This may resolve when using different versions of dependencies; however, thought it would be prudent to report a solution to this error.

Error Trace:

Module build failed (from ./node_modules/@nuxt/postcss8/node_modules/css-loader/dist/cjs.js):
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by "exports" in /Users/kananen/Documents/workspace/fun/bioicons/node_modules/postcss/package.json
    at new NodeError (node:internal/errors:393:5)
    at exportsNotFound (node:internal/modules/esm/resolve:295:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:631:9)
    at resolveExports (node:internal/modules/cjs/loader:538:36)
    at Module._findPath (node:internal/modules/cjs/loader:607:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1025:27)
    at Module._load (node:internal/modules/cjs/loader:885:27)
    at Module.require (node:internal/modules/cjs/loader:1105:19)
    at n (/Users/kananen/Documents/workspace/fun/bioicons/node_modules/jiti/dist/v8cache.js:2:2349)
    at Object.<anonymous> (/Users/kananen/Documents/workspace/fun/bioicons/node_modules/@nuxt/postcss8/node_modules/css-loader/dist/index.js:12:39)
    at o._compile (/Users/kananen/Documents/workspace/fun/bioicons/node_modules/jiti/dist/v8cache.js:2:2655)
    at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
    at Module.load (node:internal/modules/cjs/loader:1081:32)
    at Module._load (node:internal/modules/cjs/loader:922:12)
    at Module.require (node:internal/modules/cjs/loader:1105:19)
    at n (/Users/kananen/Documents/workspace/fun/bioicons/node_modules/jiti/dist/v8cache.js:2:2349)
                                                      friendly-errors 02:30:16
 @ ./node_modules/vue-tour/dist/vue-tour.css 4:14-195 15:3-20:5 16:22-203
 @ ./plugins/vue-tour.js
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi ./node_modules/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js

Solution
The bioicons/node_modules/postcss/package.json json should be configured with "import": "./index.js", and "./package.json": "./package.json" as shown below:

{
  "name": "postcss",
  "version": "8.2.8",
  "description": "Tool for transforming styles with JS plugins",
  "engines": {
    "node": "^10 || ^12 || >=14"
  },
  "exports": {
    "./package.json": "./package.json",
    ".": {
      "require": "./lib/postcss.js",
      "import": "./index.js",
      "import": "./lib/postcss.mjs",
      "types": "./lib/postcss.d.ts"
    },
    "./": "./"
  },
  "main": "./lib/postcss.js",
  "types": "./lib/postcss.d.ts",
  "keywords": [
    "css",
    "postcss",
    "rework",
    "preprocessor",
    "parser",
    "source map",
    "transform",
    "manipulation",
    "transpiler"
  ],
  "funding": {
    "type": "opencollective",
    "url": "https://opencollective.com/postcss/"
  },
  "author": "Andrey Sitnik <[email protected]>",
  "license": "MIT",
  "homepage": "https://postcss.org/",
  "repository": "postcss/postcss",
  "dependencies": {
    "colorette": "^1.2.2",
    "nanoid": "^3.1.20",
    "source-map": "^0.6.1"
  },
  "browser": {
    "./lib/terminal-highlight": false,
    "colorette": false,
    "fs": false,
    "path": false
  }

@duerrsimon
Copy link
Owner

Thanks, I'll keep this up but normally it should not be necessary to run it locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants