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

Unable to build project after adding this package #43

Closed
5 tasks done
cjholowatyj opened this issue Mar 11, 2024 · 4 comments
Closed
5 tasks done

Unable to build project after adding this package #43

cjholowatyj opened this issue Mar 11, 2024 · 4 comments

Comments

@cjholowatyj
Copy link
Contributor

Describe the bug

Upon attempting to use unplugin-vue-markdown within my project, I get the following error during build time:

"extname" is not exported by "__vite-browser-external:path", imported by "node_modules/.pnpm/@[email protected]/node_modules/@rollup/pluginutils/dist/es/index.js".
file: node_modules/.pnpm/@[email protected]/node_modules/@rollup/pluginutils/dist/es/index.js:1:9
1: import { extname, win32, posix, isAbsolute, resolve } from 'path';
            ^

If I add vite-plugin-node-polyfills to my Vite config and polyfill path then I get the following error:

"createRequire" is not exported by "__vite-browser-external:module", imported by "node_modules/.pnpm/[email protected][email protected]/node_modules/unplugin-vue-markdown/dist/chunk-XC4FHL6S.js".
file: node_modules/.pnpm/[email protected][email protected]/node_modules/unplugin-vue-markdown/dist/chunk-XC4FHL6S.js:259:9
259: import { createRequire } from "module";
              ^

If I then polyfill module I get the following error:

"createRequire" is not exported by "node_modules/.pnpm/[email protected]/node_modules/node-stdlib-browser/esm/mock/empty.js", imported by "node_modules/.pnpm/[email protected][email protected]/node_modules/unplugin-vue-markdown/dist/chunk-XC4FHL6S.js".
file: node_modules/.pnpm/[email protected][email protected]/node_modules/unplugin-vue-markdown/dist/chunk-XC4FHL6S.js:259:9
259: import { createRequire } from "module";
              ^

How do I get over this roadblock to using unplugin-vue-markdown within my project?

PS this is my current dev stack:
Laravel 10 / InertiaJS 1 / VueJS 3 / ViteJS 4 / TailwindCSS 3 / Vitest 0.31 / VitePress 1 / Typescript / SSR / FontAwesome Pro 6 / Ploi.io / Qodana / Cypress / ImgIX / HubSpot / SendGrid / SignEasy / Stripe

Reproduction

would have started a discussion here to get support, but there's no discussion tab here :(

System Info

System:
    OS: macOS 14.4
    CPU: (8) arm64 Apple M1 Pro
    Memory: 62.33 MB / 16.00 GB
    Shell: 5.2.15 - /opt/homebrew/bin/bash
  Binaries:
    Node: 21.6.2 - /opt/homebrew/bin/node
    Yarn: 1.22.21 - /opt/homebrew/bin/yarn
    npm: 10.2.4 - /opt/homebrew/bin/npm
    pnpm: 8.6.1 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 122.0.6261.112
    Safari: 17.4

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@s-light
Copy link

s-light commented Feb 16, 2025

i think i just had a very similar bug:

$ quasar dev

 .d88888b.
d88P" "Y88b
888     888
888     888 888  888  8888b.  .d8888b   8888b.  888d888
888     888 888  888     "88b 88K          "88b 888P"
888 Y8b 888 888  888 .d888888 "Y8888b. .d888888 888
Y88b.Y8b88P Y88b 888 888  888      X88 888  888 888
 "Y888888"   "Y88888 "Y888888  88888P' "Y888888 888
       Y8b

node:internal/modules/esm/resolve:303
  return new ERR_PACKAGE_PATH_NOT_EXPORTED(
         ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/stefan/myproject/node_modules/markdown-it-async/package.json
    at exportsNotFound (node:internal/modules/esm/resolve:303:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:593:13)
    at resolveExports (node:internal/modules/cjs/loader:591:36)
    at Module._findPath (node:internal/modules/cjs/loader:668:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at /home/stefan/myproject/node_modules/unplugin-vue-markdown/dist/chunk-QCQKKB2O.cjs:118:96
    at async /home/stefan/myproject/node_modules/unplugin-vue-markdown/dist/chunk-QCQKKB2O.cjs:118:37 {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v20.11.0

maybe its something different...

would love to test this out in my project..

@s-light
Copy link

s-light commented Feb 16, 2025

after upgrading my full stack it is working (partly - but that is another question i have first to understand..)

@benjivm
Copy link

benjivm commented Feb 17, 2025

@s-light what do you mean by "upgrading your full stack?", all packages in my package.json file are up to date, but I am also receiving the same error you did:

No "exports" main defined in ./node_modules/markdown-it-async/package.json
    at exportsNotFound (node:internal/modules/esm/resolve:314:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:604:13)
    at resolveExports (node:internal/modules/cjs/loader:653:36)
    at Function._findPath (node:internal/modules/cjs/loader:742:31)
    at Function._resolveFilename (node:internal/modules/cjs/loader:1380:27)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1050:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1055:22)
    at Function._load (node:internal/modules/cjs/loader:1204:37)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:234:24) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'

Dropping down to v28.1.0 fixes it.

@antfu
Copy link
Member

antfu commented Feb 17, 2025

We temporarily closed this due to the lack of enough information. We could not identify whether it was a bug or a userland misconfiguration with the given info.
Please provide a minimal reproduction to reopen the issue.
Thanks.

Why reproduction is required

@antfu antfu closed this as completed Feb 17, 2025
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

4 participants