-
Notifications
You must be signed in to change notification settings - Fork 127
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
ofetch.create is not a function #198
Labels
bug
Something isn't working
Comments
import { ofetch } from 'ofetch';
const request = ofetch.create({ baseURL: '/api' });
console.log(request);
// [Function: $fetch2] {
// raw: [AsyncFunction: $fetchRaw2],
// native: [Function (anonymous)],
// create: [Function (anonymous)]
// }
console.log(process.version);
// v14.19.3 |
Would you provide a minimal reproduction instead of a screenshot and reopen this issue later? |
This seems to be an issue with cjs exports. cjs (create is not a function): https://stackblitz.com/edit/node-9rgwsr?file=index.js module (create runs correctly): https://stackblitz.com/edit/node-wqz68m?file=index.js |
This was referenced Jan 30, 2023
Trugamr
added a commit
to Trugamr/sony-tv-api
that referenced
this issue
Feb 20, 2023
fixed cjs import issues in unjs/ofetch#198
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
node version is 14.18.0,ofetch version is 1.0.0
Reproduction
Describe the bug
I want to use ofecth.create function to create baseUrl,but appear ofetch.create is not a function . plz
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: