-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
TypeError: Cannot convert a Symbol value to a string when making production build #2751
Comments
+1 |
Found the problem, mobx includes parameters in minified errors like this: |
Released as 6.1.1 (well, in ~30 minutes that is if CI succeeds) |
It works |
Still the exact same issue in 6.1.6. |
@Tarpsvo There is a test, so it's unlikely to be exactly the same issue. Can you provide a reproduction? |
I tried to create a minimum reproducible repo, but can't reproduce it outside of the main project. (Yes, I have From my debugging, this seems to happen:
And that's where shit hits the fan. I see from the logs that the If I try the same code in the browser, I get the same exception: So I guess the issue boils down to why the transpiled code doesn't call No clue to be honest. |
It really looks like you're using older version - perhaps a stupid question, but have you re-build production build after updating mobx? |
Yes I have. The screenshot of the minified code comes from I can't figure out why it happens in my actual project, but not the minimal repro project. Could it be the issue with missing .toString()? |
Might also be worth mentioning that the crash happens on the server (using React SSR here) and only in the production build. Works fine in dev. |
Alright, switching to makeObservable works in my case. I'll just stick to that and compensate where needed. |
I read it wrong ... do you use |
Yeah... whoops. :( |
Was the intention to use decorators as overrides? |
My coworker changed the Weird thing is that it worked and went unnoticed when using MobX 6.0.5. |
Btw EDIT: Found the problem, it's caused by |
Intended outcome:
I am able to compile my NextJS or other React project while
NODE_ENV=production
.Actual outcome:
I receive the following error:
How to reproduce the issue:
I've created a minimal example repository on GitHub that exhibits this behavior here: https://github.com/markrawls/mobx-symbol-error-example
If you manually downgrade MobX to 6.0.5 or 6.0.4, it works as expected. If you forcibly set
NODE_ENV=development
(or any nonproduction
string) for the build process, the build completes as expected. This is obviously suboptimal as we want to produce a production bundle.Versions
The exclusively effects MobX 6.1.0. Downgrading to 6.0.4 or 6.0.5 resolves this issue.
The text was updated successfully, but these errors were encountered: