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

Cannot use the router plugin in commonjs webpack config #3186

Open
paypal-edveriksson opened this issue Jan 17, 2025 · 0 comments
Open

Cannot use the router plugin in commonjs webpack config #3186

paypal-edveriksson opened this issue Jan 17, 2025 · 0 comments

Comments

@paypal-edveriksson
Copy link

Which project does this relate to?

Router

Describe the bug

This is the error that happens. chalk v5 does not provide support for commonjs. Since this package do provide commonjs exports I think this is a bug that should be fixed here.

[webpack-cli] Failed to load 'webpack.config.js' config
[webpack-cli] Error [ERR_REQUIRE_ESM]: require() of ES Module node_modules/@tanstack/router-plugin/node_modules/chalk/source/index.js from node_modules/@tanstack/router-plugin/dist/cjs/logger.cjs not supported.

Your Example Website or App

https://stackblitz.com/edit/github-q2lephbt-bqg6uxll?file=README.md

Steps to Reproduce the Bug or Issue

Node v18
Define a webpack.config.js

const {
  TanStackRouterWebpack
} = require('@tanstack/router-plugin/webpack')

run webpack cli with config

Expected behavior

It should not fail on chalk v5.

Screenshots or Videos

No response

Platform

Additional context

No response

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

1 participant