Git Product home page Git Product logo

Comments (7)

markdalgleish avatar markdalgleish commented on May 18, 2024

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.

cliffordfajardo avatar cliffordfajardo commented on May 18, 2024

@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.

kiliman avatar kiliman commented on May 18, 2024

@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.

cliffordfajardo avatar cliffordfajardo commented on May 18, 2024

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

image

from remix.

markdalgleish avatar markdalgleish commented on May 18, 2024

@cliffordfajardo Looks like you also need to exclude dotfiles in ignoredRouteFiles:

remix({
  ignoredRouteFiles: ["**/*", "**/.*"],
  routes: (defineRoutes) => {
    return createRoutesFromFolders(defineRoutes, {
      ignoredFilePatterns: ["**/.*", "**/*.css"],
    });
  },
})

from remix.

markdalgleish avatar markdalgleish commented on May 18, 2024

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.

markdalgleish avatar markdalgleish commented on May 18, 2024

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)

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.