question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Monorepo vite project get 404 error

See original GitHub issue

I’m facing the same issue

GET http://localhost:3000/@id/packages/ui/src/Button/button.css.ts$$$dashboard.vanilla.js net::ERR_ABORTED 404 (Not Found)`.

the app is using turborepo. All versions are latest. app’s viteconfig

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react(),vanillaExtractPlugin()]
})

package.json

{
  "dependencies": {
    "ui": "*",
    "@vanilla-extract/css": "^1.6.8",
    "react": "^17.0.2",
    "react-dom": "^17.0.2"
  },
  "devDependencies": {
    "eslint-config": "*",
    "@types/react": "^17.0.33",
    "@types/react-dom": "^17.0.10",
    "@vanilla-extract/vite-plugin": "^3.1.2",
    "@vitejs/plugin-react": "^1.0.7",
    "eslint": "^8.5.0",
    "tsconfig": "*",
    "typescript": "^4.4.4",
    "vite": "^2.7.2"
  }
}
</div>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
edenstromcommented, Mar 21, 2022

This looks to be caused from .. being invalid in a URL. Hopefully fixed in the next patch.

Tried it locally and worked like a charm! 👌 Thanks!

(Copy-pasted the changed lines into dist/vanilla-extract-vite-plugin.cjs.dev.js)

1reaction
florianmatzcommented, Feb 18, 2022

Experiencing the same issue, also with turborepo, better said (npm) workspaces.

What worked for me is indeed putting the site instead of the app folder into the packages next to my ui-kit.

Like:

  • apps
    • site -> not working
  • packages
    • ui-kit
    • site -> working

ui-kit is a dependency in the sites package.json:

„dependencies“: { „ui-kit“: „*“ }

Still, it feels not good, starting a repo with breaking conventions.

It seems to me, the described fix only fixed it ‚one level‘ higher in the folder hierarchy?

@markdalgleish or @mattcompiles Could you provide some assistance?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Monorepo vite project get 404 error · Discussion #555 - GitHub
the app is using turborepo. All versions are latest. app's viteconfig. import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import { ......
Read more >
React.js (Vite) application returns 404 when refreshed on route
Mistake was related to the codebase (where I'm using monorepo and vercel.json was on the root directory. After moving vercel.js to package with ......
Read more >
Introduction to Nxext Vite
Introduction to Nxext Vite #. @nxext/vite is a nx plugin to bring Solid and Svelte to Nx. We at Nxext believe the key...
Read more >
404 page not found nextJS - Netlify Support Forums
My site: https://joyful-froyo-cb853f.netlify.app/ I have deployed this site but when I try to access it it gives following error Build ...
Read more >
Migrating to Next.js: Incrementally Adopting Next.js
When Next.js matches the dynamic route it stops checking any further routes. Using notFound: true in getStaticProps will return the 404 page without...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found