Closed adamduncan closed 1 year ago
Thanks for reporting this @adamduncan! This was working and was tested so not sure what's up. I'll speak to the team to see if anything changed recently.
@adamduncan, I figured out the issue. One, the error is because things did get updated on our end, so
// Import path interpreted by the Remix compiler
import * as build from "@remix-run/dev/server-build";
import { createRequestHandler } from "@netlify/remix-edge-adapter";
export default createRequestHandler({
build,
// process.env.NODE_ENV is provided by Remix at compile time
mode: process.env.NODE_ENV,
});
export const config = {
cache: "manual",
path: "/*",
// Let the CDN handle requests for static assets, i.e. /_assets/*
//
// Add other exclusions here, e.g. "/api/*" for custom Netlify functions or
// custom Netlify Edge Functions
- excluded_patterns: ["/_assets/*"],
+ excluded_patterns: ["^/_assets/*$"],
};
but also, you'll need to update the app/routes/index.tsx
to app/routes/_index.tsx
. It's part of the new Remix routing. I have a PR up for it, but I guess it's no longer behind their future flag. See https://github.com/netlify/remix-template/pull/105.
I'll create a PR to update both these things. Thanks again for reporting this!
@nickytonline Thanks for following up on this so swiftly! Appreciate the insights 👍
Yep, looks like with that change to excluded_patterns: ["^/_assets/*$"]
and the _index.tsx
file renaming, things are deploying and functioning as expected: https://netlify-remix-template-test.netlify.app
Describe the bug Trying to build and deploy out-of-the-box
remix-template
to Netlify. No modifications made to template after install. App builds and runs locally withnetlify dev
without an issue. When runningnetlify deploy --build
, seeing an error regardingexcluded_patterns
To Reproduce Steps to reproduce the behavior:
npx create-remix@latest --template netlify/remix-template
TypeScript
npm install
Run your Remix site with: Netlify Edge Functions (beta)
cd
into install directorynetlify dev
(works fine locally, including use of edge functions if created in/netlify/edge-functions/
dir)npm run build
(succeeds)netlify deploy --build
— fails with above message ☝️Expected behavior Successful deployment to Netlify
Screenshots
Desktop:
Additional context As suggested, I attempted to set
excluded_patterns
to:excluded_patterns: [/^\/_assets\/\*$/]
— Same error (same regardless of whether string/regex wrapped innew RegExp()
or not)excluded_patterns: ["^/_assets/*$"]
— Builds and deploys successfully (example) but app isn't rendering as expected / as it does locally vianetlify dev
. Note: Interestingly, if I create an edge function, that is behaving as expected (example), even though the app itself isn't rendering.excluded_patterns: []
— As above