Skip to content
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

use oyster-common with next.js #545

Open
Tetdoss opened this issue May 17, 2022 · 1 comment
Open

use oyster-common with next.js #545

Tetdoss opened this issue May 17, 2022 · 1 comment

Comments

@Tetdoss
Copy link

Tetdoss commented May 17, 2022

Hello,

I'm trying to use oyster-common with next.js :

I added in package.json : "oyster-common": "^0.0.2"

But there are some dependencies conflicts so it creates a nested node_modules in node_modules/oyster-common/node_modules

And this nested node_modules doesn't seem to be transpiled...
So I added in next.config.js :

const withTM = require('next-transpile-modules')(['oyster-common'], { debug: true });
module.exports = withTM({});

Here is the code i'm trying to use :

import { useStore } from 'oyster-common/dist/lib/contexts/store';

But now I have this issue :

Unhandled Runtime Error
ReferenceError: exports is not defined

Call Stack
eval
node_modules/oyster-common/dist/lib/contexts/store.js (22:0)
Module../node_modules/oyster-common/dist/lib/contexts/store.js

If you have any help, thank you !

@memokey
Copy link

memokey commented Jul 5, 2022

Hi, I have same issue when I use @oysterr/[email protected]. is there any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants