-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
instanceof
breaks in dev mode
#9528
Comments
Here's a modification of the above minimum reproduction repo, but it uses rollup https://github.com/rohanrajpal/svelte-headless-table-rollup
Since Vite uses Rollup, I was just canceling the possibility of an error there. Tho, I have little knowledge of how Vite works, so not sure if this experiment was actually of any help. |
I can confirm that this bug exists. In my case it appeared in JSBI lib. There's |
We also have the problem that Comment in issue: fabian-hiller/modular-forms#59 (comment) |
Any news on this issue? |
Any updates on the potential fixes? Tried with:
same results |
Duplicate of #3910 |
Describe the bug
I am building a table library for Svelte which uses classes and
instanceof
checks quite extensively. I've noticed that the behaviour ofinstanceof
is different betweenyarn dev
andyarn build && yarn preview
. More specifically,instanceof
returns false in cases where I expect it to return true.My core library (
svelte-headless-table
) exposes an argument that accepts an object of plugins. These plugins are exported fromsvelte-headless-table/plugins
that can extend the library's functionality. Some plugins useinstanceof
checks for their logic, butinstanceof
results in incorrect behaviour.The issue persists with
npm
andpnpm
.Catching the issue
The issue does not surface if I use
npm link
orpnpm.overrides
to debug the package. I've only been able to catch the issue by addingconsole.log
statements to the packaged library files innode_modules/
. I've added instructions to the reproduction repo on how to do so.Dev mode
Preview mode
Relevant discussion
An existing issue thread exists here.
Reproduction
https://github.com/bryanmylee/svelte-headless-table-vite-instanceof-check
System Info
Used Package Manager
yarn
Logs
No errors are thrown and the library fails silently in
dev
.Validations
The text was updated successfully, but these errors were encountered: