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

fix: invalid module transform for @headlessui/react #54206

Merged
merged 2 commits into from Aug 18, 2023

Conversation

opnay
Copy link
Contributor

@opnay opnay commented Aug 18, 2023

occured since #54188

  • *: use kebabcase instead of lowercase
  • Transition: components/transitions/transition
  • Tab: components/tabs/tabs
- wait compiling /not-found (client and server)...
- error ./node_modules/.pnpm/@headlessui+react@1.7.17_react-dom@18.2.0_react@18.2.0/node_modules/@headlessui/react/dist/headlessui.esm.js:2:0
Module not found: Can't resolve '/Projects/node_modules/.pnpm/@headlessui+react@1.7.17_react-dom@18.2.0_react@18.2.0/node_modules/@headlessui/react/dist/components/tab/tab'

occured since vercel#54188

- *: use kebabcase instead of lowercase
- Transition: `components/transitions/transition`
- Tab: `components/tabs/tabs`
@vercel-spaces
Copy link

vercel-spaces bot commented Aug 18, 2023

Notifying the following users due to files changed in this PR based on this repo's notify modifiers:

@timneutkens, @ijjk, @shuding, @styfle, @huozhi:

packages/next/src/server/config.ts

12 similar comments
@vercel-spaces-staging
Copy link

Notifying the following users due to files changed in this PR based on this repo's notify modifiers:

@timneutkens, @ijjk, @shuding, @styfle, @huozhi:

packages/next/src/server/config.ts

@vercel-spaces-staging
Copy link

Notifying the following users due to files changed in this PR based on this repo's notify modifiers:

@timneutkens, @ijjk, @shuding, @styfle, @huozhi:

packages/next/src/server/config.ts

@vercel-spaces
Copy link

vercel-spaces bot commented Aug 18, 2023

Notifying the following users due to files changed in this PR based on this repo's notify modifiers:

@timneutkens, @ijjk, @shuding, @styfle, @huozhi:

packages/next/src/server/config.ts

@vercel-spaces-staging
Copy link

Notifying the following users due to files changed in this PR based on this repo's notify modifiers:

@timneutkens, @ijjk, @shuding, @styfle, @huozhi:

packages/next/src/server/config.ts

@vercel-spaces
Copy link

vercel-spaces bot commented Aug 18, 2023

Notifying the following users due to files changed in this PR based on this repo's notify modifiers:

@timneutkens, @ijjk, @shuding, @styfle, @huozhi:

packages/next/src/server/config.ts

@vercel-spaces
Copy link

vercel-spaces bot commented Aug 18, 2023

Notifying the following users due to files changed in this PR based on this repo's notify modifiers:

@timneutkens, @ijjk, @shuding, @styfle, @huozhi:

packages/next/src/server/config.ts

@vercel-spaces-staging
Copy link

Notifying the following users due to files changed in this PR based on this repo's notify modifiers:

@timneutkens, @ijjk, @shuding, @styfle, @huozhi:

packages/next/src/server/config.ts

@vercel-spaces
Copy link

vercel-spaces bot commented Aug 18, 2023

Notifying the following users due to files changed in this PR based on this repo's notify modifiers:

@timneutkens, @ijjk, @shuding, @styfle, @huozhi:

packages/next/src/server/config.ts

@vercel-spaces
Copy link

vercel-spaces bot commented Aug 18, 2023

Notifying the following users due to files changed in this PR based on this repo's notify modifiers:

@timneutkens, @ijjk, @shuding, @styfle, @huozhi:

packages/next/src/server/config.ts

@vercel-spaces-staging
Copy link

Notifying the following users due to files changed in this PR based on this repo's notify modifiers:

@timneutkens, @ijjk, @shuding, @styfle, @huozhi:

packages/next/src/server/config.ts

@vercel-spaces-staging
Copy link

Notifying the following users due to files changed in this PR based on this repo's notify modifiers:

@timneutkens, @ijjk, @shuding, @styfle, @huozhi:

packages/next/src/server/config.ts

@vercel-spaces
Copy link

vercel-spaces bot commented Aug 18, 2023

Notifying the following users due to files changed in this PR based on this repo's notify modifiers:

@timneutkens, @ijjk, @shuding, @styfle, @huozhi:

packages/next/src/server/config.ts

timneutkens
timneutkens previously approved these changes Aug 18, 2023
@kodiakhq kodiakhq bot merged commit 132d3e8 into vercel:canary Aug 18, 2023
48 of 51 checks passed
@weyert
Copy link

weyert commented Aug 19, 2023

@shuding This is not fixing the problem for unit tests:

 FAIL  src/__tests__/pages/CallbackPage.test.tsx
  ● Test suite failed to run

    Cannot find module 'modularize-import-loader?name=Dialog&join=./components/dialog/dialog!@headlessui/react' from 'src/layouts/SiteLayout.tsx'

    Require stack:
      src/layouts/SiteLayout.tsx
      src/layouts/getLayoutComponent.tsx
      src/pages/auth/callback.tsx
      src/__tests__/pages/CallbackPage.test.tsx

      21 | import { useAuth } from '@/auth/usercontext/useAuth'
      22 |
    > 23 | interface SiteLayoutProps extends Omit<LayoutProps, 'Layout'> {
         |                ^
      24 |   children: React.ReactNode
      25 |   showCategoriesList?: boolean
      26 | }

      at Resolver._throwModNotFoundError (../../node_modules/.pnpm/jest-resolve@29.6.2/node_modules/jest-resolve/build/resolver.js:427:11)
      at Object.<anonymous> (src/layouts/SiteLayout.tsx:23:16)
      at Object.<anonymous> (src/layouts/getLayoutComponent.tsx:11:21)
      at Object.<anonymous> (src/pages/apps/auth/callback.tsx:37:29)
      at Object.<anonymous> (src/__tests__/pages/CallbackPage.test.tsx:13:19)

@Bowens20832
Copy link
Contributor

@shuding This is not fixing the problem for unit tests:

 FAIL  src/__tests__/pages/CallbackPage.test.tsx
  ● Test suite failed to run

    Cannot find module 'modularize-import-loader?name=Dialog&join=./components/dialog/dialog!@headlessui/react' from 'src/layouts/SiteLayout.tsx'

    Require stack:
      src/layouts/SiteLayout.tsx
      src/layouts/getLayoutComponent.tsx
      src/pages/auth/callback.tsx
      src/__tests__/pages/CallbackPage.test.tsx

      21 | import { useAuth } from '@/auth/usercontext/useAuth'
      22 |
    > 23 | interface SiteLayoutProps extends Omit<LayoutProps, 'Layout'> {
         |                ^
      24 |   children: React.ReactNode
      25 |   showCategoriesList?: boolean
      26 | }

      at Resolver._throwModNotFoundError (../../node_modules/.pnpm/jest-resolve@29.6.2/node_modules/jest-resolve/build/resolver.js:427:11)
      at Object.<anonymous> (src/layouts/SiteLayout.tsx:23:16)
      at Object.<anonymous> (src/layouts/getLayoutComponent.tsx:11:21)
      at Object.<anonymous> (src/pages/apps/auth/callback.tsx:37:29)
      at Object.<anonymous> (src/__tests__/pages/CallbackPage.test.tsx:13:19)

I can confirm @timneutkens that this is still an issue while running Jest tests in the latest Next.js release.

Any suggestions on a fix?

@weyert
Copy link

weyert commented Aug 27, 2023

Yes, I haven't figured out a way to solve this issue besides downgrading to an older version which don't have the rules defined.

@Bowens20832
Copy link
Contributor

Yes, I haven't figured out a way to solve this issue besides downgrading to an older version which don't have the rules defined.

Which version worked for you?

@aguscorvo
Copy link

Yes, I haven't figured out a way to solve this issue besides downgrading to an older version which don't have the rules defined.

Which version worked for you?

@Bowens20832 13.4.12 worked for me.

@Bowens20832
Copy link
Contributor

13.4.12

This works! Thank you so much 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants