Coder Social home page Coder Social logo

Comments (14)

yesmeck avatar yesmeck commented on May 21, 2024

I haven't tested it, but it should work with remix-flat-routes. I will have a look later.

from remix-routes.

adaboese avatar adaboese commented on May 21, 2024

Been trying to debug why it isn't working, but so far no luck

from remix-routes.

yesmeck avatar yesmeck commented on May 21, 2024

Just tested remix-routes with remix-flat-routes. It works without errors. Could you create a reproducible repo?

from remix-routes.

adaboese avatar adaboese commented on May 21, 2024

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.

adaboese avatar adaboese commented on May 21, 2024

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.

adaboese avatar adaboese commented on May 21, 2024

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.

yesmeck avatar yesmeck commented on May 21, 2024

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.

adaboese avatar adaboese commented on May 21, 2024

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.

yesmeck avatar yesmeck commented on May 21, 2024

remix-routes doesn't load vite.config.ts, but @remix-run/dev does.

from remix-routes.

adaboese avatar adaboese commented on May 21, 2024

I guess I am trying to understand how to further troubleshoot this.

from remix-routes.

yesmeck avatar yesmeck commented on May 21, 2024

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.

yesmeck avatar yesmeck commented on May 21, 2024

I'm working on a Vite plugin to address this issue.

from remix-routes.

yesmeck avatar yesmeck commented on May 21, 2024

I just released [email protected] with a Vite plugin. It should work better with Vite now.

from remix-routes.

adaboese avatar adaboese commented on May 21, 2024

Yay! This works. Thank you!

from remix-routes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.