upmostly / modali

A delightful modal dialog component for React, built from the ground up to support React Hooks.
212 stars 23 forks source link

Incompatible with `Next.js`. #49

Open rommelmamedov opened 3 years ago

rommelmamedov commented 3 years ago

Error: "Global CSS cannot be imported from within node_modules." error in Next.js

It's because of CSS import in main index.js file.

https://github.com/upmostly/modali/blob/1a1f58a70167dda11f4a2b8492bd4a0bcdb4fc92/src/index.js#L6

darwinshameran commented 3 years ago

Using @zeit/next-css yields error:

.modali-overlay {
^

SyntaxError: Unexpected token '.'
    at wrapSafe (node:internal/modules/cjs/loader:1018:16)
    at Module._compile (node:internal/modules/cjs/loader:1066:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10)
    at Module.load (node:internal/modules/cjs/loader:967:32)
    at Function.Module._load (node:internal/modules/cjs/loader:807:14)
    at Module.require (node:internal/modules/cjs/loader:991:19)
    at require (node:internal/modules/cjs/helpers:92:18)
atefBB commented 3 years ago

@rommelmamedov Did you solve this issue? Any help can be appreciated!

ramilmamedoff commented 3 years ago

@rommelmamedov Did you solve this issue? Any help can be appreciated!

No, I just used React-Modal :)