Comments (14)
I am reluctant to dispense such unlimited agreement π
But I don't believe webpack 5 has this issue.
from ofetch.
Perhaps try adding ohmyfetch
to the transpile array as well?
from ofetch.
@danielroe Doesn't seem to work
build.transpile: ['ohmyfetch', 'destr', 'ufo', '@maartenvanhunsel/nuxt-statamic'],
"ohmyfetch": "^0.4.15",
from ofetch.
I have the same problem months ago, when I found ohmyfetch, and the error was because the particular import of Webpack in Nuxt2: The ohmyfetch package expose 4 types of bundles depending of the import mode (if it was from a ES module or a CJS module) and the environment (if it was for Node or for the browser), but I don't know why Webpack or Nuxt can't understand the dynamic import of the module. If you want to import ohmyfetch in a module for Nuxt2 you need to split your imports in 2 plugins: one that imports the CJS file directly and one server plugin that imports the polyfills needed for Node (just like in the @nuxt/http) module.
from ofetch.
Hi @BrandonlinU do you have an example of that :D ?
from ofetch.
What is your node version?
from ofetch.
Hi @danielroe
node version : 16.15.1
I have tried with the last one : 16.17.0 same error
There is my plugin api file : https://gist.github.com/joffreyBerrier/cd5c8c0a4fd7fa1db78fbcb442098269
Error when i have added ohmyfetch
on nuxt.config.js
transpile: ['vee-validate/dist/rules', 'ohmyfetch'],
Thx
from ofetch.
Any idea @danielroe ? :)
from ofetch.
It's hard to say without a minimal reproduction.
from ofetch.
Hi @danielroe there is an example π
https://github.com/joffreyBerrier/nuxt-ohmyfetch
from ofetch.
I'm afraid this is a known bug in webpack 4 which was resolved in webpack 5.
You can work around it like this, as we do in Bridge:
https://stackblitz.com/edit/github-vtace5?file=nuxt.config.js
https://github.com/nuxt/bridge/blob/2dfed6aa69a60999d581d4d0ec71ea80bc478e51/src/app.ts#L89-L102
from ofetch.
OMG thanks a lot @danielroe you are a King ! π
Do we agree that I can push my app in production without problem with webpack 5 ?
from ofetch.
Thx a lot π
from ofetch.
Since there is a workaround for the issue, I will close this issue for now.
Please reopen it as needed.
from ofetch.
Related Issues (20)
- Pick function HOT 1
- Typed API definition HOT 12
- Response does not contain headers HOT 2
- Receiving server-sent events (SSE) HOT 2
- Failed to upload Mega-sized base64 image HOT 1
- Go-like syntax to handle errors HOT 6
- error.statusText & error.statusMessage are undefined after Nuxt build but are set in dev
- deprecate `params` alias for `query` HOT 1
- the HTTP(S) Agent invalid HOT 7
- Can access to typed data in interceptors HOT 2
- Set cookies HOT 11
- error on Response.blob()
- Multipart image upload not working with fetch but with RapidAPI HOT 4
- Missing types in node export HOT 1
- `body` vs `params` option HOT 1
- Inconsistent headers object returned after a retried request
- TS2305: Module 'ofetch' has no exported member FetchOptions HOT 1
- Errors in Interceptors are silently handled
- How to handle errors body HOT 1
- GraphQL Support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ofetch.