-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Add support for Remix v2.0.0 #228
Comments
v2 is already in the works. You can use it today by instlaling remix-utils@next |
So, quick fix |
installing remix-utils@next I'm still getting this new error now:
|
|
Exports definitions are different for v2, this is the published Lines 54 to 187 in d766238
The examples in the v2 README are updated with the correct imports, but all IDEs should be able to suggest the correct ones to use. |
I'm seeing: [1] ✘ [ERROR] Could not resolve "remix-utils"
[1]
[1] app/components/RichTextRenderer.tsx:21:27:
[1] 21 │ import { ClientOnly } from 'remix-utils';
[1] ╵ ~~~~~~~~~~~~~
[1]
[1] The path "." is not exported by package "remix-utils":
[1]
[1] node_modules/remix-utils/package.json:54:13:
[1] 54 │ "exports": {
[1] ╵ ^
[1]
[1] You can mark the path "remix-utils" as external to exclude it from the bundle, which will remove this error. |
Why is no one reading the v2 documentation or even just this #228 (comment), in this same issue, from yesterday? 😅 You CAN'T write this anymore: import { ... } from "remix-utils"; You have to use the correct imports that are shown in all the new examples in the v2 README.md, e.g. for import { ClientOnly } from "remix-utils/client-only"; Your IDE should be more than capable of suggesting the correct imports, just delete the old ones that don't work anymore. |
That doesn't work either. VS Code is not finding those subdirectories for the import statement and when running
Any help would be greatly appreciated. |
This error is because Remix Utils v7 will ship ESM-only code, and it seems you Remix app is generating CJS code as the build output for the server, so you can't You need to add |
@sergiodxa How can i use it then when i added it to i stuck a little bit here. |
Probably because some people are just following guides from other docs or articles that have not been updated to V2 then finding an issue and coming here. |
@mufftee and other people who have the same problem. You must use regex, not string like this: // remix.config.js
...
serverDependenciesToBundle: [
/remix-utils/ // not "remix-utils"
],
...
// in your file component
import { ClientOnly } from "remix-utils/client-only"; |
Works like a charm! |
In case this helps anyone else, I needed to update these settings in
|
I think for now you need to npm install with --legacy-peer-deps |
Would be great if the peer dependencies could be updated so that we didn't need the --legacy-peer-deps flag. |
✅ I updated my tsconfig.json's Apparently remix templates have been using NOTE: I was initially curious about how References |
@cliffordfajardo indeed thats the correct tsconfig and it also worked for me, but the dependencies are still not updated and its still required to run |
thanks @zifahm . I was even the one who created the discussion in discord. Idk how i missed that comment. "overrides": {
"remix-utils": {
"@remix-run/react": "^2.0.1",
"@remix-run/server-runtime": "^2.0.1"
}
}, |
How can i do this with the new version?
am getting |
You can't anymore, and you should have never done this because it would cause all utils to be bundled. |
oh so in the old code, this:
leads to less being bundled than this:
? I would have thought they lead to the same amount being bundled, is this a remix specific difference? |
That's how bundlers work, by doing In the next version of Remix Utils (a new pre-release has been published btw which uses Remix v2 as dependency) each util will have a unique import path like |
Why were some of the utilities removed in the latest version ? Namely |
Most of those response utils where just wrappers of Response helpers that add extra features or don't wrap |
Also v7.0.1 with Remix v2 support is out as stable release https://github.com/sergiodxa/remix-utils/releases/tag/v7.0.1. Closing this since it's released now, for any specific problem please open a new issue to treat them individually. |
So, what do we do with badRequest and forbidden from V6? |
@saashqdev You can always copy them to your own codebase (they are here and here), or do |
Ah, cool. Thanks a lot. |
Love this new version, thanks for everything with this 🙏 May I recommend adding the dropped response utils to changelog or the Upgrade notes? Used those all over an app and thought I was taking crazy pills until I dug down into the packages. Simple enough to replace but may make upgrade easier for some. |
@benjamindulau did you restart your Typescript server after the installation? In the bottom right corner, you can see it |
@cjoecker Yep! I restarted the entire IDE, cleared cache, restarted Typescript, everything (well I hope not everything since I didn't do what works :p) |
Nevermind, didn't notice but IntelliJ was using the wrong Typescript version (4.x). Fixing this and setting |
Using VS Code, remix 2.3.1 and remix-utils 7.3.0 with Indie Stack, and I'm getting |
@nicolasrenon Ensure you have TS v5, that your tsconfig.json has moduleResolution set to |
@sergiodxa Yes, currently running TS v5.2.2. Update: it seems fine after switching from |
If you can't switch moduleResolution to bundler then you can't upgrade to Remix Utils v7 and get TS to recognize the imports |
I'm also having this issue. Switching module resolution to "Bundler" will solve it, but that causes problems in other places.. |
I ran into the same issue that @manzaloros mentioned above when upgrading to Remix v2 + vite; However, |
Note that |
Describe the bug
Remix v2 has deprecated
useTransition
in favor ofuseNavigation
as documented here: https://remix.run/docs/en/2.0.0/start/v2#usetransitionAfter upgrading to Remix v2, the following error occurs:
Your Example Website or App
https://github.com/jgentes/mixpoint
Steps to Reproduce the Bug or Issue
Go to package.json, update all remix dependencies to "2.0.0" and run "yarn", then "yarn dev"
Expected behavior
Probably ought to update
remix-utils
to the latest version of RemixScreenshots or Videos
No response
Platform
Windows, edge
Additional context
No response
The text was updated successfully, but these errors were encountered: