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

"ERROR: Could not map all functions to an entry in the manifest." when adding basePath to next.config.js #42

Closed
kendall-wahnschaffe opened this issue Dec 16, 2022 · 3 comments · Fixed by #44

Comments

@kendall-wahnschaffe
Copy link

Out of the box, everything works

✅ Works as expected
Following steps 1 - 4 from the (README)[https://github.com/cloudflare/next-on-pages#quick-start]

✅ Works as expected
npx @cloudflare/next-on-pages --experimental-minify

✅ Deploys as expected
npx wrangler pages publish .vercel/output/static/

However, with basePath

Add basePath to next.config.js

const nextConfig = {
  basePath: "/base-path",
  experimental: {
    runtime: "experimental-edge",
  },
  reactStrictMode: true,
};

❌ Does not work.
npx @cloudflare/next-on-pages --experimental-minify

Build completes, but logs the following ERROR:

ERROR: Could not map all functions to an entry in the manifest.

Furthermore, if I proceed to deploy the application, I get a browser HTTP ERROR 404 at /base-path and the application's 404 page at /base-path/

@hanford
Copy link
Contributor

hanford commented Dec 21, 2022

This happens to me as well. I rely on basePath pretty heavily in order to have many Next.js applications on the same hostname.

I've created a repro over here: https://github.com/hanford/next-on-pages-42 and can also be messaged on the Cloudflare Discord as @hanford if any additional information is helpful

@hanford
Copy link
Contributor

hanford commented Dec 30, 2022

I believe #44 should add proper support for basePath on next-on-pages. I've got the changes in the PR available in .patch that can be applied using something like patch-package

The patch file is here: https://gist.github.com/hanford/9308f35b5d12a3c225a0045cf6bff3c8

(unrelated, also in the patch, I've disabled the prepInstall function because I've been using Pages direct upload and next-on-pages doesn't yet support many package managers (#11), if desired I can create a new patch without that change..

@rationalthug
Copy link

Will this fix be accepted in the near future? I utilize basePath extensively as well and am using Pages' GitHub integration, which causes the build to fail with this same error.

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

Successfully merging a pull request may close this issue.

4 participants