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

Unknown error when setting up NextJS config #171

Open
Janealter opened this issue Nov 10, 2024 · 6 comments
Open

Unknown error when setting up NextJS config #171

Janealter opened this issue Nov 10, 2024 · 6 comments

Comments

@Janealter
Copy link

Unknown error when setting up NextJS config:

Injecting property=output and value=export in:
import bundleAnalyzer from '@next/bundle-analyzer';
const withBundleAnalyzer = bundleAnalyzer({
  enabled: process.env.ANALYZE === 'true',
});
export default withBundleAnalyzer({
  reactStrictMode: false,
  eslint: {
    ignoreDuringBuilds: true,
  },
  experimental: {
    optimizePackageImports: ['@mantine/core', '@mantine/hooks'],
  },
});
Error: TypeError: error must be an instance of Error
@Janealter
Copy link
Author

As I tested, this is because my config contains

import bundleAnalyzer from '@next/bundle-analyzer';

const withBundleAnalyzer = bundleAnalyzer({
  enabled: process.env.ANALYZE === 'true',
});

@Janealter
Copy link
Author

I think this PR solves the issue - #161

@rajatsandeepsen
Copy link

I saw a similar issue in Nextjs Repo

Then made a complex work around in workspace yml to solve this issue

Like

  1. reset the next.config file to default with zero configurations
  2. then run the Setup Pages (it will add some important info like basePath to config)
  3. then edit the next.config file to merge your configuration and configuration from setup pages

Example

@vicb
Copy link

vicb commented Jan 31, 2025

Hey,
Any update here, it looks like #161 solve this issue.

@JamesMGreene would you be able to get do something?

Thanks!

@JamesMGreene
Copy link
Contributor

@vicb Alas, I'm no longer on the Pages team, so can't help you there. 👋🏻

@yoannchaudet Anything the team will be able to look at soon, or would you perhaps suggest that folks may need to fork the action for now? 🤷🏻

@vicb
Copy link

vicb commented Jan 31, 2025

@JamesMGreene thanks for your quick answer! And best of luck on your new team.

We'll try to use an older version or fork in the meantime.

🙏

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

4 participants