Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignoredFilePatterns error when launching #89

Open
pburrows opened this issue Nov 29, 2023 · 1 comment
Open

ignoredFilePatterns error when launching #89

pburrows opened this issue Nov 29, 2023 · 1 comment

Comments

@pburrows
Copy link

Trying to get remix-flat-routes working and am getting the error:

TypeError: ignoredFilePatterns.map is not a function
    at flatRoutes (C:\dev\btc\bigpicture\src\bp-app-remix\node_modules\@remix-run\dev\dist\config\flat-routes.js:71:46)

My remix.config.js looks like this:

import {flatRoutes} from "@remix-run/dev/dist/config/flat-routes.js";

/** @type {import('@remix-run/dev').AppConfig} */
export default {
  ignoredRouteFiles: ["**/.*"],
  serverModuleFormat: "esm",
  routes: async defineRoutes => {
    const routes = flatRoutes('routes', defineRoutes)
    console.log(routes)
    return routes

  }
  // appDirectory: "app",
  // assetsBuildDirectory: "public/build",
  // publicPath: "/build/",
  // serverBuildPath: "build/index.js",
};

and I have renamed my routes to follow the folder conventions (so I have folders paths like this:

routes/auth/signup/_signup.tsx and
routes/projects/$project/_project.tsx

I searched the archives here and I don't see anyone else with this ignoredFilePatterns error, so I'm not sure what I'm doing wrong.

Thanks!

@kiliman
Copy link
Owner

kiliman commented Nov 29, 2023

Hmm.. I haven't seen that issue before.

First of all, it looks like your import is wrong.

import { flatRoutes } from 'remix-flat-routes'

Also, your ignoredRouteFiles setting is incorrect. That setting applies to the Remix default convention. You need to specify that all files should be ignored.

ignoredRouteFiles: ["**/*"] // ignore all files (remove the .)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants