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

Module failed to compile #436

Closed
casualmatt opened this issue Nov 28, 2024 · 8 comments
Closed

Module failed to compile #436

casualmatt opened this issue Nov 28, 2024 · 8 comments
Assignees
Labels
bug Something isn't working upstream

Comments

@casualmatt
Copy link

Environment

  • Operating System: Linux
  • Node Version: v20.17.0
  • Nuxt Version: 3.14.1592
  • CLI Version: 3.16.0
  • Nitro Version: 2.10.4
  • Package Manager: [email protected]
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

pnpm dlx nuxi init -t module my-module

or nuxt-user-country module

Describe the bug

It's impossible to compile, and not even a clean nuxt module was generated by the starter project.

Additional context

No response

Logs

matteo@dev-container:~/git/jamflow/module$ pnpm prepack

> [email protected] prepack /home/dev/git/jamflow/module
> nuxt-module-build build

ℹ Building my-module                                                                                                                                                                  5:11:23 PM
ℹ Cleaning dist directory: ./dist                                                                                                                                                     5:11:23 PM
.nuxt/components.plugin.mjs(3,1): error TS2742: The inferred type of 'default' cannot be named without a reference to '~/node_modules/nuxt/dist/app/nuxt.js'. This is likely not portable. A type annotation is necessary.


 ERROR  Failed to compile. Check the logs above.                                                                                                                                       5:11:25 PM

  at error (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:2287:30)
  at Object.error (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:25351:20)
  at Object.error (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:24472:42)
  at generateDtsFromTs (node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/rollup-plugin-dts/dist/rollup-plugin-dts.mjs:1834:30)
  at Object.transform (node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/rollup-plugin-dts/dist/rollup-plugin-dts.mjs:1843:38)
  at node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:25544:40
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 



 ERROR  Failed to compile. Check the logs above.                                                                                                                                       5:11:25 PM

 ELIFECYCLE  Command failed with exit code 1.
Copy link

Stackblitz link for the reproduction: Stackblitz

@huang-julien huang-julien added the bug Something isn't working label Nov 29, 2024
@casualmatt
Copy link
Author

Probably a duplicate of #141

@danielroe danielroe transferred this issue from nuxt/nuxt Nov 29, 2024
@BobbieGoede
Copy link
Member

We're getting the same error when trying to build the i18n module with [email protected] (https://github.com/nuxt-modules/i18n/actions/runs/12095017311/job/33856223860?pr=3251), it builds fine with typescript@~5.6.

I have checked and installing typescript@~5.6 in the reproduction will fix the error described, though it will still fail due to other unrelated issues.

@danielroe danielroe self-assigned this Dec 6, 2024
@danielroe
Copy link
Member

This is likely caused by vuejs/language-tools#5018.

@sandros94
Copy link

Oh, for some reason I wasn't subbed to this and didn't see @BobbieGoede's message. Indeed it fixes the build issue for nuxt-user-country and new modules from Nuxt's starters.

Thanks @danielroe, subbing there to track that issue.

@amery
Copy link

amery commented Jan 30, 2025

still happening 😭

@sandros94
Copy link

still happening 😭

even if you pinned typescript to 5.6.3 and vue-tsc to 2.1.6?

@amery
Copy link

amery commented Jan 30, 2025

still happening 😭

even if you pinned typescript to 5.6.3 and vue-tsc to 2.1.6?

Thanks, I had only downgraded typescript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
Development

No branches or pull requests

6 participants