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

Recent Ky Update No Longer Works With Next.js #348

Closed
LuisOsta opened this issue May 16, 2021 · 3 comments
Closed

Recent Ky Update No Longer Works With Next.js #348

LuisOsta opened this issue May 16, 2021 · 3 comments

Comments

@LuisOsta
Copy link

I recently noticed while trying to get the ky-universal package working with Next.js that the latest version of Ky doesn't work at all. Even though it recently worked just fine.

Starting in version '0.28.0' and onwards, the error:

 error - ./services/requests.ts:1:0
client_1  | Module not found: Can't resolve 'ky'
client_1  | > 1 | import ky from "ky";
client_1  |   2 | 
client_1  |   3 | const prefixUrl = process.env.NEXT_PUBLIC_API_URL;
client_1  |   4 | export const AUTH_HEADER_NAME = "Authorization";

Appears in relation to ky. But it works perfectly fine in version '0.27.1'. Looking at the changelog, I'm not entirely sure what it could be.

Here's my next.config.js for context:

const withTM = require("next-transpile-modules")(["ky"]);

module.exports = withTM({
  future: {
    webpack5: false,
  },
});
@LuisOsta
Copy link
Author

My guess is that it may have been related to the move to Typescript, but that seems like a weird thing to cause a module resolution bug.

@dakshshah96
Copy link

Duplicate of #340.

@sholladay
Copy link
Collaborator

Indeed, this is a duplicate. You can try PR #342 to see if that fixes it for you. Feedback on that PR is welcome, especially if it doesn't work for you.

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

No branches or pull requests

3 participants