Open baharnadimi opened 4 months ago
@baharnadimi
It may not make any difference to your issue, but Node.js 19
is no longer supported. Node 18
, 20
, & 22
are the currently supported versions.
Hello, I have the exact same problem and I have been scratching my head for the past two days.
I am using cypress latest version: 13.15.0
I'm using component testing with webpack bundler and nextjs framework
node version: 20
This happens on component testing that is using a package that has a dependency with this error:
x Using export * from '...'
in a page is disallowed. Please use export { default } from '...'
instead.
| Read more: https://nextjs.org/docs/messages/export-all-in-page
,-[/Users/j{name}/Desktop/Repos/{project}node_modules/date-fns/index.mjs:233:1]
233 | export from "./subISOWeekYears.mjs";
234 | export from "./subMilliseconds.mjs";
235 | export from "./subMinutes.mjs";
236 | export from "./subMonths.mjs";
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
237 | export from "./subQuarters.mjs";
238 | export from "./subSeconds.mjs";
239 | export * from "./subWeeks.mjs";
`----
this happens with both swc that came with nextjs and babel
I'll try and create a sample project soon
anyone found solution or what?
getting same issue:
1 | "use client";
2 |
3 | import Button from './button';
4 | export * from './buttonHelpers';
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5 | export default Button;
`----
Having the same exact issue, any updates?
Adding this to my next.config.js
file worked for me with date-fns
if (process.env.NODE_ENV === "test") {
config.transpilePackages = ["date-fns", "date-fns-tz"];
}
date-fns-tz
is only needed if you use it.
In case this helps anyone, there's a relate issue open at: https://github.com/cypress-io/cypress/issues/26802
A workaround is to add an empty /pages
directory at the root of the project. It immediatly solved the import error for me. I don't know if there will be consequences to this workaround tough.
Current behavior
Desired behavior
No response
Test code to reproduce
Cypress Version
^13.12.0
Node version
v18
Operating System
Ubuntu 22.04.4 LTS
Debug Logs
No response
Other
No response