You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How are you deploying your application? (if relevant)
No response
Describe the Bug
I used npx create-next-app@latest --example with-jest with-jest-app to create the project
Than i added @mui/material and all required dependencies.
Than i created the hook and the test.
I tried adding the @mui to transpilePackages in next.config.js but it didn't help.
without entry in transpilePackages:
C:\Users\...\IdeaProjects\with-jest-app\node_modules\@mui\material\index.js:9
import * as colors from './colors';
^^^^^^
SyntaxError: Cannot use import statement outside a module
7 | // Mock the theme with breakpoints
8 | const theme = createTheme({
> 9 | breakpoints: {
| ^
10 | values: {
11 | xs: 0,
12 | sm: 600,
at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1505:14)
at Object.<anonymous> (hooks/__tests__/useIsMobile.test.tsx:9:16)
with entry in transpilePackages:
C:\Users\...\IdeaProjects\with-jest-app\node_modules\@babel\runtime\helpers\esm\extends.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){export default function _extends() {
^^^^^^
SyntaxError: Unexpected token 'export'
7 | // Mock the theme with breakpoints
8 | const theme = createTheme({
> 9 | breakpoints: {
| ^
10 | values: {
11 | xs: 0,
12 | sm: 600,
at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1505:14)
at Object.<anonymous> (hooks/__tests__/useIsMobile.test.tsx:9:16)
Verify canary release
Provide environment information
Which example does this report relate to?
with-jest
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
I used
npx create-next-app@latest --example with-jest with-jest-app
to create the projectThan i added
@mui/material
and all required dependencies.Than i created the hook and the test.
I tried adding the
@mui
totranspilePackages
innext.config.js
but it didn't help.without entry in
transpilePackages
:with entry in
transpilePackages
:Expected Behavior
jest test should run.
To Reproduce
The text was updated successfully, but these errors were encountered: