Comments (7)
I wasn't able to reproduce this issue, both manually and when running your repro.
I've pushed my attempt at a manual reproduction here. Can you check whether this works for you? https://github.com/markdalgleish/remix-vite-express-with-v1-routes
By the way, I noticed that a sync routes
function in the Remix Vite plugin options is incorrectly flagged as a type error (and that you had to work around this too), so I've opened a PR to fix this: #8745
from remix.
@markdalgleish - thanks for the quick response
Turns out this error from using @remix-run/v1-route-convention
comes from accidenally having a .DS_STORE
file inside the routes
folder: #6256
I deleted the .DS_STORE
file & the v1 routes started working & the build does generate build/server
# ran from the top of the root of my repo
find . -name ".DS_Store" -type f -delete
from remix.
@cliffordfajardo Do you set the ignoredFilePatterns
to ignore dotfiles?
/** @type {import(https://github.com/remix-run/remix/tree/master/packages/remix-dev).AppConfig} */
module.exports = {
// Tell Remix to ignore everything in the routes directory.
// We'll let `createRoutesFromFolders` take care of that.
ignoredRouteFiles: ["**/*"],
routes: (defineRoutes) => {
// `createRoutesFromFolders` will create routes for all files in the
// routes directory using the same default conventions as Remix v1.
return createRoutesFromFolders(defineRoutes, {
// If you're already using `ignoredRouteFiles` in your Remix config,
// you can move them to `ignoredFilePatterns` in the plugin's options.
// ignore dotfiles
ignoredFilePatterns: ["**/.*", "**/*.css"],
});
},
};
from remix.
Do you set the ignoredFilePatterns to ignore dotfiles? - @kiliman
For the PrefixLookupTrie
error, the problem was indeed due to having a .DS_STORE
file inside of routes
folder, so I just deleted it the file:
# ran from root of my remix project - then restarted dev server
find . -name ".DS_Store" -type f -delete
I was curious about the ignoredRouteFiles: ["**/*"]
at the root of the remix
config and ignoredFilePatterns
inside of createRoutesFromFolders
- they dont work when using them inside of vite.config.js
When you're using vite
, the docs recommend not having remix.config.js
file anymore
https://remix.run/docs/en/main/future/vite#configuration
Created a bug reproduction repo
https://github.com/cliffordfajardo/bug-remix-v1-routing-vite-config
from remix.
@cliffordfajardo Looks like you also need to exclude dotfiles in ignoredRouteFiles
:
remix({
ignoredRouteFiles: ["**/*", "**/.*"],
routes: (defineRoutes) => {
return createRoutesFromFolders(defineRoutes, {
ignoredFilePatterns: ["**/.*", "**/*.css"],
});
},
})
from remix.
I've fixed this in the v1-route-convention readme: https://github.com/remix-run/v1-compat-utils/tree/main/packages/v1-route-convention
from remix.
I've also opened a PR updating all the Vite templates to set ignoredRouteFiles
to ["**/.*"]
to avoid this issue coming up in that context too: #8800
from remix.
Related Issues (20)
- useMatches returns a new object for each call even though the matches are stable and are not changing HOT 2
- npx create-remix@latest install deps failure HOT 3
- "verbatimModuleSyntax": true causes import {type} from '@remix-run/node' to run on the browser HOT 1
- You cannot `useLoaderData` in an errorElement (routeId: root) HOT 2
- Vite + createFileUploadHandler: file uploading error HOT 3
- remix-vite with radix-ui/themes@next suffrers serving allow list problem HOT 3
- Remix latest version throwing Hyderation Failed Error HOT 5
- Initial URL (/vaults) does not match URL at time of hydration (/manage), reloading page... HOT 2
- Fetcher data missing when JavaScript is not enabled HOT 10
- Using regular CSS throws '[vite] Internal server error: URI malformed' HOT 4
- "Error: Remix Vite plugin can't detect preamble. Something is wrong." when running component tests with Vitest HOT 6
- null is not an object (evaluating 'document.head.appendChild') HOT 4
- using `remix routes` with remix-flat-routes + vite breaks HOT 1
- `useFetcher().Form` scrolls to top of the page even when `preventScrollReset` is used
- Cloudflare deploys crashing for Remix Vite when using `import { createCookie } from "@remix-run/cloudflare";` HOT 2
- [BUG] - `?_data=` common problem since v1
- In Vite build.sourcemap = true doesn't generate sourcemaps HOT 3
- How to use socket.io with remix last version ? HOT 3
- Remix removes injected html from external script HOT 1
- Remix + Vite unable to use client only libs HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from remix.