-
Notifications
You must be signed in to change notification settings - Fork 7
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
[Bug]: Problem with old safari version #107
Comments
|
Thanks for your answer
Which is great, one library less.
Not sure about this. It says it there Also, it did fix my problem with @serwis not getting properly transpiled according to my
I did, but it seems that the transpilation of the node modules should happen in the libraries themselves.
Unfortunately that's how Sentry identifies Safari: Apple Mail XXX... Not ideal, I know |
Again, the use case of the package is for transpiling local modules, which are not transpiled by Next.js by default (most likely?). It is most likely intended for making such modules work on the server, since Node.js can't import i.e. TypeScript code, rather than for magically making your code compatible with older browsers. That is the job of webpack and SWC. Unless I'm missing out on some Next.js dark magic, it should transpile any library code for browsers coming its way.
Not sure what you are talking about. This has always been the job of the transpiler and bundler you choose. You should consult them should you find an issue with how the code is generated. |
I might be wrong, for sure. The thing is that it says there that it is for compiling node modules when using Next.JS. Of course Next does this taking into account your setting for the code of the application one is building, but I'm not sure about node_modules. If Next already did that, I'm not sure why this library exists (and why Next decided to added it to its core settings), but as I say I'd need to dig deeper into it. I guess the main point is that @serwist wasn't working on old browsers until I added it to /** @type {import('next').NextConfig} */
module.exports = withSerwist({
eslint: {
ignoreDuringBuilds: true,
},
transpilePackages: ['@serwist/window', '@serwist/core'], // I needed to add this two
swcMinify: true, |
It should take care of that. Otherwise, you may as well throw |
Man, knowing you put this project together, I'm pretty sure you are right. But, come on, I'm just trying to help. I've been around for quite a bit and I am SURE if I have these problems (or the ones I posted on another issue) other people will too, so take it easy. We are just trying to help. Certain stuff in your previous responses were like "ok.... seems I cannot even point out a problem here..." Thanks again for your effort and your responses. Honestly, just trying to to constructive stuff here. |
Sorry if I've been a bit too hostile previously, but the commuting was really bad today... I do see the problem you are having right now, but I still think that it is on Next.js/SWC rather than Serwist. I believe that Next.js does transpile the code, but seeing that your using I'm still inclined to believe that |
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
Provide environment information
Next.js 14.
No particular configuration.
Which project is this issue for?
@serwist/next
Link to reproduction - Issues with a link to complete (but minimal) reproduction code help us address them faster
Unfortunately it is a private repository.
To reproduce
Open a serwist website in Safari 14 or below and check the developer console.
Describe the bug
We've noticed that after deploying @Serwist/next we start getting frontend reports of errors like this
After checking it, we realized it was only happening with MacOS X 10.15.6 and browser
Apple Mail 605.1.15
.The error appeared in
main.js
and it was on the Serwist part.The website doesn't load because of this.
After doing some research in the code, the problem comes from parts of the code like
or
We've been able to fix it using
next-transpile-modules
, something like thisOf course, it is nice that it works with this workaround, but wanted to share the problem in case you weren't aware of it.
Expected behavior
To be able to load the website.
Screenshots (if relevant)
No response
Additional information (if relevant)
No response
The text was updated successfully, but these errors were encountered: