|
1 | 1 | ##Feedback |
2 | 2 |
|
3 | | -- Files from`public` not in`outputs.staticFiles` |
| 3 | +- Files from`public`directorynot listed in`outputs.staticFiles` |
4 | 4 | - In`onBuildComplete` -`config.images.remotePatterns` type is`(RemotePattern | URL)[]` but in |
5 | 5 | reality`URL` inputs are converted to`RemotePattern` so type should be just`RemotePattern[]` |
6 | | --`routes.headers` does not contain immutable cache-control headers for\_next/static |
| 6 | +-`routes.headers` does not contain immutable cache-control headers for`_next/static` |
7 | 7 | -`outputs.middleware` does not contain env that exist in`middleware-manifest.json` (i.e. |
8 | | - NEXT_SERVER_ACTIONS_ENCRYPTION_KEY,**NEXT_PREVIEW_MODE_ID,**NEXT_PREVIEW_MODE_SIGNING_KEY etc) |
| 8 | +`NEXT_SERVER_ACTIONS_ENCRYPTION_KEY`,`NEXT_PREVIEW_MODE_ID`,`NEXT_PREVIEW_MODE_SIGNING_KEY` etc) |
9 | 9 | -`outputs.middleware.config.matchers` can be undefined per types - can that ever happen? Can we |
10 | 10 | just have empty array instead to simplify handling. |
| 11 | +-`outputs.staticFiles` (i18n enabled) custom fully static (no`getStaticProps`)`/pages/404.js` |
| 12 | +`filePath` point to not existing file (it doesn't have i18n locale prefix in`staticFiles` array, |
| 13 | + actual 404.html are written to i18n locale prefixed directories) |
| 14 | +-`outputs.staticFiles` (i18n enabled) custom`/pages/404.js` with`getStaticProps` result in fatal |
| 15 | +`Error: Invariant: failed to find source route /en/404 for prerender /en/404` directly from |
| 16 | + Next.js: |
| 17 | + |
| 18 | +``` |
| 19 | + ⨯ Failed to run onBuildComplete from Netlify |
| 20 | +
|
| 21 | + > Build error occurred |
| 22 | + Error: Invariant: failed to find source route /en/404 for prerender /en/404 |
| 23 | +``` |
| 24 | + |
| 25 | + (additionally - invariant is reported as failing to run`onBuildComplete` from adapter, but it |
| 26 | + happens before adapter's`onBuildComplete` runs, would be good to clear this up a bit so users |
| 27 | + could report issues in correct place in such cases. Not that important for nearest future / not |
| 28 | + blocking) |
11 | 29 |
|
12 | 30 | ##Plan |
13 | 31 |
|
|
18 | 36 | 2. We will use adapters API where it's most helpful: |
19 | 37 |
|
20 | 38 | - adjusting next config: |
21 | | -- set standalone mode instead of using "private" env var (for now at least we will continue with |
22 | | - standalone mode as using outputs other than middleware require bigger changes which will be |
| 39 | +-[done]set standalone mode instead of using "private" env var (for now at least we will continue |
| 40 | +withstandalone mode as using outputs other than middleware require bigger changes which will be |
23 | 41 | explored in later phases) |
24 | | -- set image loader (url generator) to use Netlify Image CDN directly (no need for\_next/image |
25 | | - rewrite then) |
| 42 | +-[done]set image loader (url generator) to use Netlify Image CDN directly (no need for |
| 43 | +\_next/imagerewrite then) |
26 | 44 | - (maybe/explore) set build time cache handler to avoid having to read output of default cache |
27 | 45 | handler and convert those files into blobs to upload later |
28 | | -- use middleware output to generate middleware edge function |
29 | | -- don't glob for static files and use`outputs.staticFiles` instead |
| 46 | +-[partially done - for edge runtime]use middleware output to generate middleware edge function |
| 47 | +-[done]don't glob for static files and use`outputs.staticFiles` instead |
30 | 48 | - don't read various manifest files manually and use provided context in`onBuildComplete` instead |
31 | 49 |
|
32 | 50 | ##To figure out |
|
36 | 54 | packagePath, publishDir etc) |
37 | 55 | - Looking forward - Platform change to accept a list of files to upload to cdn (avoids file system |
38 | 56 | operations such as`cp`) |
| 57 | +- Looking forward - allow using regexes for static headers matcher (needed to apply next.config.js |
| 58 | + defined headers to apply to static assets) |