Rewrites to _next/static
files not working
#2628
Labels
Next.js e2e test failure
Errors identified through the Next.js repo e2e tests
_next/static
files not working
#2628
Asset prefix tests with fixture like this: https://github.com/vercel/next.js/blob/4837a67fb9bc7199e48cd8bd2cc42659b17dfacc/test/e2e/app-dir/asset-prefix/next.config.js
is unable to handle rewrite that would match static files (such as
/custom-asset-prefix/_next/static/chunks/app/page-0c41902c3edd4280.js
which should just serve/_next/static/chunks/app/page-0c41902c3edd4280.js
)This results in failure for those tests:
Some investigation notes:
It seems like next-server is building maps of various such files on server initialization ( https://github.com/vercel/next.js/blob/4837a67fb9bc7199e48cd8bd2cc42659b17dfacc/packages/next/src/server/lib/router-utils/filesystem.ts#L98-L680 ) and later used in when handling requests ( https://github.com/vercel/next.js/blob/4837a67fb9bc7199e48cd8bd2cc42659b17dfacc/packages/next/src/server/lib/router-server.ts#L417-L525 ), but we are not bundling those files into server handler and therefore it falls back to 404 case that we see.
This is possible same root issue as #2465 (?)
Data
The following is parsed automatically by the Next.js repo e2e test report generator.
test: test/e2e/app-dir/asset-prefix/asset-prefix.test.ts, test/e2e/app-dir/asset-prefix-with-basepath/asset-prefix-with-basepath.test.ts
reason: Rewrites to _next/static files not working
The text was updated successfully, but these errors were encountered: