question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transpile nuxt2 module

See original GitHub issue

I’m creating a nuxt module for both: nuxt2 and nuxt3. However I’m having some trouble by building a nuxt2 project by using nuxt generate. The module is using the OhMyFetch module which is not transpiled. Does anyone know what I have to do to get this fixed? I’m getting these kind of import errors:

Basically what I do is the following:

  1. I do use the https://github.com/nuxt/module-builder template.
  2. The build nuxt-module-build is going correctly and all files are generated.
  3. At this point I use npm publish for github package registry
  4. When adding the (build)module I’m getting some node-fetch / ohmyfetch related errors:

Can't resolve 'node:buffer' Can't resolve 'node:http' ...

Also I do have tried the build.transpile: ['module-name] config. Any thoughts? Thanks 😄

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
danielroecommented, Sep 15, 2022

I am reluctant to dispense such unlimited agreement 😜

But I don’t believe webpack 5 has this issue.

0reactions
joffreyBerriercommented, Sep 15, 2022

Thx a lot 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I transpile a dependency in node_modules with ...
I have read of issues with transpiling node_modules with Nuxt, but the new Nuxt 2 is said to have solved this with a...
Read more >
Add support to transpile modules inside node_modules
One solution would be to transpile it as stated above, we've just downgraded the module to v5 (which is plain ES5). 1
Read more >
How can I transpile a dependency in node_modules with Nuxt ...
Coding example for the question How can I transpile a dependency in node_modules with Nuxt 2?-babel.js.
Read more >
The build Property
Display build indicator for hot module replacement in development ... In this example, ky will be transpiled by Babel if Nuxt is not...
Read more >
Introduction to Nuxt 3 modules
For the previous version of Nuxt (also the most stable right now), we had a repository template for building new Nuxt 2 modules...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found