-
Notifications
You must be signed in to change notification settings - Fork 88
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
Problem with es modules with next.js #194
Comments
|
works with |
looks similar to: matthewp/robot-hooks#12 |
robot-hooks has a CommonJS build and this does not (don't remember why). Should just port the build stuff over to here and have a CJS version. |
What is the best workaround for this? |
@resusio, as a temporary solution I use import { useEffect, useState } from 'react';
import { createUseMachine } from 'robot-hooks';
export const useMachine = createUseMachine(useEffect, useState); |
Moving to the main repo. Still open to having a CJS build as some of the others do. |
Hello! having a similar issue. We use robot3 in our open source ORM (https://github.com/Blitzapps/blitz-orm)
So it works locally for this package but not when exporting this package into other ones. The problem is that being used in an intermediary pkg i'm not able to exchange it by its hook version. Also it is used in the api-route side of nextjs so it would make no sense to use hooks Any idea on another workaround? |
As an ugly workaround I just copied machine.js into a .ts file inside my project and ignored the types. This way nextjs is ok with the imports. Tried lots of alternatives without success. |
https://codesandbox.io/s/recursing-breeze-n34wd?file=/pages/index.js
The text was updated successfully, but these errors were encountered: