virtual-core doesn't load in browser due to expecting process.env.NODE_ENV
I'm trying this library out in vanilla JS and getting an error due to the library checking process.env.NODE_ENV in several spots. Could this be checked safely so it doesn't blow up in browsers?
2 Replies
genetic-orange•11mo ago
Hey @Voltz - it doesn't look like the npm package is meant to be used directly in the browser like that. Maybe you could use something like esm.sh, which should work in the browser without any need for build steps:
https://esm.sh/@tanstack/virtual-core@3.10.8
conscious-sapphireOP•11mo ago
Thank you for the response @roddds . It looks like that module works. I was just expecting the virtual core shipped in npm's dist/ to work without needing any build step. Just want to clear any confusion, the website says this library is framework agnostic. Does that mean it's only meant to work for the frameworks that have wrappers and not vanilla JS?