Comments (14)
I haven't tested it, but it should work with remix-flat-routes. I will have a look later.
from remix-routes.
Been trying to debug why it isn't working, but so far no luck
from remix-routes.
Just tested remix-routes
with remix-flat-routes
. It works without errors. Could you create a reproducible repo?
from remix-routes.
When I inspect:
async function build(remixRoot, flags) {
const config = await readConfig(remixRoot);
const [routesInfo, routeIds] = await buildHelpers(config);
console.log(config.routes);
generate(config, routesInfo, routeIds, remixRoot, flags);
}
all it shows { root: { path: '', id: 'root', file: 'root.tsx' } }
.
Presumably, this should have all the routes?
from remix-routes.
Does it matter that I use Remix though vite.config.ts
?
plugins.push(
remix({
ignoredRouteFiles: ['**/*'],
routes: async (defineRoutes) => {
return flatRoutes('routes', defineRoutes, {
ignoredRouteFiles: ['**/.*'],
});
},
serverModuleFormat: 'esm',
}),
);
from remix-routes.
It looks like it never even tries to load vite.config.ts
.
I added throw new Error('OK');
to that file, and it does not fail.
from remix-routes.
It doesn't matter whether you use Vite or not. However, if vite.config.ts
is not loaded, it seems to be an issue with the way you are using Remix.
from remix-routes.
I mean, I expect vite.config.ts
to be loaded when I run remix-routes
command, or am I misunderstanding how this works?
from remix-routes.
remix-routes
doesn't load vite.config.ts
, but @remix-run/dev
does.
from remix-routes.
I guess I am trying to understand how to further troubleshoot this.
from remix-routes.
Oh, I think I know why it doesn't work now. remix-routes
relies on @remix-run/dev
to get route information. However, when you run remix-routes
, @remix-run/dev
doesn't recognize that you are using Vite.
from remix-routes.
I'm working on a Vite plugin to address this issue.
from remix-routes.
I just released [email protected]
with a Vite plugin. It should work better with Vite now.
from remix-routes.
Yay! This works. Thank you!
from remix-routes.
Related Issues (20)
- Feature Request: Optional exporting query param type and making the $path more type safe HOT 12
- Add SearchParams to $params HOT 7
- [Feature]: Support for `flat-routes` (v2) routing convention. HOT 6
- [Bug]: Directory splash routes translate with errors. HOT 2
- Wrapping $path function HOT 10
- [Suggestion]: Typechecking route id's HOT 2
- Broken on 1.4.0 HOT 3
- Empty params always required HOT 4
- routes with exported SearchParams require empty {}
- Use template literal types to expose list of routes HOT 2
- Show type error when redirecting with search params when route has no SearchParams exported
- Catch all routes cannot handle "index route" HOT 1
- Typescript bug: A 'declare' modifier cannot be used in an already ambient context. HOT 1
- Support for vite HOT 3
- [FEAT] Allow changing strict mode on a per-route basis HOT 1
- [BUG] `undefined` and `null` query parameter become part of the URL HOT 1
- typescript plugin doesn't work
- Type errors for all routes that do not export SearchParams HOT 2
- Remix 2.0 support HOT 3
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-routes.