Closed c0ncentus closed 3 years ago
We're experiencing similar error with Storybook:
ERROR in ./packages/rest/src/resources/customerInvoices/endpoints/postCustomerDraftInvoice.ts 9:5
Module parse failed: Unexpected token (9:5)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| } from '../types'
|
> type PostCustomerDraftInvoiceRequestParams = VoidArgument
| interface PostCustomerDraftInvoiceRequestBodyLine {
| concept: string
@ ./packages/rest/src/resources/customerInvoices/endpoints.ts 9:0-52 9:0-52
This packages file connected as local packages through package.json
file.
Content of main.js:
const TsConfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
module.exports = {
"stories": [
"../src/**/*.stories.mdx",
"../src/**/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-actions",
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/preset-create-react-app"
],
webpackFinal: async (config, { configType }) => {
config.resolve.plugins = [new TsConfigPathsPlugin()];
return config;
}
}
Content of preview.js:
import React from 'react'
import styled, { ThemeProvider } from 'styled-components'
import { theme } from '@playtomic/manager/theme/globalStyle'
import '@playtomic/manager/styles/style.scss'
const Wrapper = styled.div``
const decorators = [
(Story) => (
<ThemeProvider theme={theme}>
<Wrapper>
<Story />
</Wrapper>
</ThemeProvider>
)
]
const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
}
export { decorators, parameters }
Content of preview.js is require ? I already dowload a package cra in react 16.9 with storybook it work for now ...
Maybe this will help when i have similar issue 👍
Don't know about that possibilities, thanks
webpackFinal: async (config, { configType }) => {
config.resolve.plugins = [new TsConfigPathsPlugin()];
return config;
}
thanks I have an other issue and then learn more about how webpack is hell, I understand more what really you do 👍
Describe the bug Work fine the first time, and then when you do and undo you cannot making things work.
To Reproduce Don't know if it will be happen but that's the way i triggered it : => Config CRA app with "react": "^16.14.0", "@storybook/addon-actions": "^6.1.11" (all storybook dependencied required in 6.1.11)
Expected behavior Do not have webpack crap
Screenshots
Code snippets => Custom Component
===> the story
System Environment Info:
System: OS: Windows 10 10.0.17134 CPU: (4) x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz Binaries: Node: 14.10.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.15.2 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.14.10 - C:\WORKBRENCH\FENEARO\Feanaro_React\node_modules.bin\npm.CMD Browsers: Edge: Spartan (42.17134.1098.0) npmPackages: @storybook/addon-actions: ^6.1.11 => 6.1.11 @storybook/addon-essentials: ^6.1.11 => 6.1.11 @storybook/addon-links: ^6.1.11 => 6.1.11 @storybook/node-logger: ^6.1.11 => 6.1.11 @storybook/preset-create-react-app: ^3.1.5 => 3.1.5 @storybook/react: ^6.1.11 => 6.1.11