Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants