Techiio-author
Started by Pritam DharMay 11, 2022

Open
Hey everyone! I‘m getting an error when I‘m adding Storybook to NextJS.

3 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 3 VIEWES SHARE

I generated the NextJS project using the TypeScript template and I want to add my Storybook to the project. The storybook is written in TypeScript. When I'm adding Storybook to my nextJS project I'm getting such a web pack error: "You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file ". Both NextJS and Storybook are using webpack 5. How is possible to fix this error?

Here is full error which I'm getting:

blogpost

1 Replies

Techiio-commentatorDebarghya Das replied 7 days ago0 likes0 dislikes

I haven't gotten everything working with Next yet but this resolved the absolute import issues

(in .storybook/webpack.config.js):

const path = require('path');
module.exports = ({config}) => {
  config.resolve.modules = [
    path.resolve(__dirname, ".."),
    "node_modules",
  ]
  return config
}

For using ./src, you can use path.resolve(__dirname, "..", "src"),

You must be Logged in to reply
Trending Technologies
15
Software40
DevOps46
Frontend Development24
Backend Development20
Server Administration17
Linux Administration26
Data Center24
Sentry24
Terraform23
Ansible83
Docker70
Penetration Testing16
Kubernetes21
NGINX20
JenkinsX17
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance