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

Does not work with Next.js #12

Open
devcshort opened this issue Jun 8, 2020 · 4 comments
Open

Does not work with Next.js #12

devcshort opened this issue Jun 8, 2020 · 4 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@devcshort
Copy link

What doesn't work

Currently when trying to use this module in a Next.js application, I get an error that says Global CSS cannot be imported from within node_modules

More about the Next.js Error

Global CSS cannot be imported from within node_modules

Temporary workaround

I managed to create a workaround in my own project by changing your package.json "main" to export dist/lib/tui-wrapper.js instead of dist/index.js AND by using a "dynamic" import in my Next.js app.

import dynamic from 'next/dynamic';
const DynamicDonut = dynamic(() => import('react-donut'), { ssr: false });
@octaviotastico
Copy link

octaviotastico commented Jul 31, 2020

It's not working for me neither :(

@import url('https://fonts.googleapis.com/css?family=Lato');
^

SyntaxError: Invalid or unexpected token
    at Module._compile (internal/modules/cjs/loader.js:891:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/octa/Escritorio/Zenrise/zenrise-rents-web-client/node_modules/react-donut/dist/index.js:12:1)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.react-donut (/home/octa/Escritorio/Zenrise/zenrise-rents-web-client/.next/server/static/development/pages/index.js:4854:18)
    at __webpack_require__ (/home/octa/Escritorio/Zenrise/zenrise-rents-web-client/.next/server/static/development/pages/index.js:23:31)
    at Module../src/components/Dashboard/PieChartDetailedCard/index.js (/home/octa/Escritorio/Zenrise/zenrise-rents-web-client/.next/server/static/development/pages/index.js:2840:69)

@meetzaveri
Copy link
Owner

@devcshort Thanks for reporting issue. I've taken necessary steps and have updated package.

@meetzaveri
Copy link
Owner

@octaviotastico Hey

I've updated package which should solve your problem. Basically there will be no global css imports now in package's codebase

@meetzaveri meetzaveri added bug Something isn't working good first issue Good for newcomers labels Sep 27, 2020
@meetzaveri meetzaveri mentioned this issue Sep 27, 2020
@devcshort
Copy link
Author

Thank you @meetzaveri

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants