Comments (5)
Hey thanks for the quick response.
I'm indeed trying to run it for a frontend application running node 20.8.0 with vite
I guess I'll have to look for for another way to go around the issues I'm experiencing but thanks anyway :)
from import-sync.
Hey @nktnet1
Thanks for the suggestion but it seems require-esm-in-cjs is also server-side only..
By the way, the error I was getting was actually related to vite:
vitejs/vite#1973
I've managed to fix it but then I started getting other errors related to node.. 🤷 I guess I'll just have to do some refactoring of the project..
Thanks again for your help!
from import-sync.
Hi @fonziemedia,
Thank you for reaching out.
Could you provide a minimal reproducible example for this issue? Other information such as your node version and the content of your package.json would help.
Note that unfortunately, import-sync only works with NodeJS (server-side), not client-side (e.g. frontend development and the like) see below. If your project is indeed NodeJS, please first confirm that you are able to access NodeJS process - e.g. as simple as
console.log(process);
Finally, the error suggests that the issue may lie with the esm module, a dependency of import-sync. It may be worth it to look through the issues in that project too to see if there are any workarounds :).
from import-sync.
@fonziemedia you can maybe try your luck with this module
although there are some performance implications to consider, for example as a result of using deasync. Hope this points you in the right direction though :).
from import-sync.
Found this fork of fractal that uses Vite and import-sync together:
so I'm not so sure about my comment regarding only server-side NodeJS anymore 🤷
e.g. it's being used here in ./packages/react/src/adapter.js#L13:
Maybe there is a configuration somewhere that allows the esm module to work.
Also found some workarounds:
- https://stackoverflow.com/a/75633477/22324694
- https://dev.to/boostup/uncaught-referenceerror-process-is-not-defined-12kg
from import-sync.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from import-sync.