FormidableLabs / prism-react-renderer

🖌️ Renders highlighted Prism output to React (+ theming & vendored Prism)
MIT License
1.88k stars 153 forks source link

Unable to start demo #235

Closed rickyzhangca closed 9 months ago

rickyzhangca commented 11 months ago

steps to reproduce

[plugin:vite:import-analysis] Failed to resolve entry for package "prism-react-renderer". The package may have incorrect main/module/exports specified in its package.json.
/Users/rickyzhangca/Documents/prism-react-renderer/packages/demo/src/App.tsx
    at packageEntryFailure (file:///Users/rickyzhangca/Documents/prism-react-renderer/node_modules/.pnpm/vite@4.2.1_@types+node@18.15.11/node_modules/vite/dist/node/chunks/dep-79892de8.js:23266:11)
    at resolvePackageEntry (file:///Users/rickyzhangca/Documents/prism-react-renderer/node_modules/.pnpm/vite@4.2.1_@types+node@18.15.11/node_modules/vite/dist/node/chunks/dep-79892de8.js:23263:5)
    at tryNodeResolve (file:///Users/rickyzhangca/Documents/prism-react-renderer/node_modules/.pnpm/vite@4.2.1_@types+node@18.15.11/node_modules/vite/dist/node/chunks/dep-79892de8.js:23000:20)
    at Context.resolveId (file:///Users/rickyzhangca/Documents/prism-react-renderer/node_modules/.pnpm/vite@4.2.1_@types+node@18.15.11/node_modules/vite/dist/node/chunks/dep-79892de8.js:22762:28)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.resolveId (file:///Users/rickyzhangca/Documents/prism-react-renderer/node_modules/.pnpm/vite@4.2.1_@types+node@18.15.11/node_modules/vite/dist/node/chunks/dep-79892de8.js:43314:32)
    at async TransformContext.resolve (file:///Users/rickyzhangca/Documents/prism-react-renderer/node_modules/.pnpm/vite@4.2.1_@types+node@18.15.11/node_modules/vite/dist/node/chunks/dep-79892de8.js:43043:23)
    at async normalizeUrl (file:///Users/rickyzhangca/Documents/prism-react-renderer/node_modules/.pnpm/vite@4.2.1_@types+node@18.15.11/node_modules/vite/dist/node/chunks/dep-79892de8.js:41370:34)
    at async TransformContext.transform (file:///Users/rickyzhangca/Documents/prism-react-renderer/node_modules/.pnpm/vite@4.2.1_@types+node@18.15.11/node_modules/vite/dist/node/chunks/dep-79892de8.js:41512:47)
    at async Object.transform (file:///Users/rickyzhangca/Documents/prism-react-renderer/node_modules/.pnpm/vite@4.2.1_@types+node@18.15.11/node_modules/vite/dist/node/chunks/dep-79892de8.js:43387:30)
    at async loadAndTransform (file:///Users/rickyzhangca/Documents/prism-react-renderer/node_modules/.pnpm/vite@4.2.1_@types+node@18.15.11/node_modules/vite/dist/node/chunks/dep-79892de8.js:41105:29
rickyzhangca commented 11 months ago

local node version is 18.18.2

carloskelly13 commented 11 months ago

Hi :wave: If you haven't built the library first, it will fail to resolve it since the demo depends on a local build. This is a good shout for us to add that to our demo documentation.

pnpm build
pnpm run start:demo

should get it up and running. I just re-verified.