Closed SebastianSchenk closed 2 years ago
So it seams the reason for that error is the configuration of '@babel/plugin-transform-runtime'. helpers
is set to !isDevelopment
. So if NODE_ENV is not production, helpers will be inlined. However, the babel plugin in rollup is configured to always use runtime
. Changing this line to isDevelopment ? 'inline' : 'runtime'
will fix this error.
Nevertheless, now there is a new error (warning):
(!) Error when using sourcemap for reporting an error: Can't resolve original location of error.
src/components/button/index.tsx (2:12)
(!) `this` has been rewritten to `undefined`
https://rollupjs.org/guide/en/#error-this-is-undefined
src/components/button/index.tsx
Hi sorry fro the late response, never mind the yarn build:watch
script, it is no longer needed. when running yarn start
storybook will automatically rebuild and on each save.
i will remove yarn build:watch
Running
yarn build:watch
throws the following error:Error: You have declared using "runtime" babelHelpers, but transforming path/to/src/index.ts resulted in "inline". Please check your configuration.
yarn build
runs without any problems, but I can*t find the difference.