You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Keystone App that contains NextApp, located in root directory of my project. For the frontend I'm using Bulma CSS framework, thus I had to override global CSS in custom App.
The difference is that instead of importing ../styles.css I import ../styles.scss. My styles.scss looks like this:
@import"../node_modules/bulma/bulma.sass";
When running the npm run dev I receive the following error:
...
✔ Initialised Keystone instance
error - ./styles/styles.scss
To use Next.js' built-in Sass support, you first need to install `sass`.
Run `npm i sass` or `yarn add sass` inside your workspace.
...
After that, I installed package sass in the directory of my frontend, that is in app/package.json.
But I'm still getting the same error. When I ran npm run dev in app, it worked.
So I think the issue is that when Keystone launches Nextjs App, it points to wrong node_modules (points to node_modules, should point to app/node_modules).
Of course I could also just install sass in project root, however I don't want to install packages twice every time my Nextjs app needs one (I suspect that's the case with not only sass package but in general for other packages too). Also, I wouldn't want to keep frontend dependencies in keystone root directory, which should only contain dependencies for backend stuff.
To Reproduce
Steps to reproduce the behaviour. Please provide code snippets or a repository:
Create a keystone project from a starter template, and then add Nextjs app.
Bug report
Describe the bug
I have a Keystone App that contains
NextApp
, located in root directory of my project. For the frontend I'm using Bulma CSS framework, thus I had to override global CSS in customApp
.The difference is that instead of importing
../styles.css
I import../styles.scss
. Mystyles.scss
looks like this:When running the
npm run dev
I receive the following error:After that, I installed package
sass
in the directory of my frontend, that is inapp/package.json
.But I'm still getting the same error. When I ran
npm run dev
inapp
, it worked.So I think the issue is that when Keystone launches Nextjs App, it points to wrong
node_modules
(points tonode_modules
, should point toapp/node_modules
).Of course I could also just install sass in project root, however I don't want to install packages twice every time my Nextjs app needs one (I suspect that's the case with not only
sass
package but in general for other packages too). Also, I wouldn't want to keep frontend dependencies in keystone root directory, which should only contain dependencies for backend stuff.To Reproduce
Steps to reproduce the behaviour. Please provide code snippets or a repository:
npx create-next-app
(project name:app
).cd app && npm install --save bulma sass
app/pages/_app.js
with following contents:app/styles/styles.sass
with following contents:cd ../ && npm run dev
sass
package has to be installed is printed.Expected behaviour
The error should not be printed. Package is installed in
app/node_modules
after all.System information
The text was updated successfully, but these errors were encountered: