-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: (tag.text || "").trim is not a function #356
Comments
Getting the same error on typescript |
This seems to be related to using |
We don't use any |
For me, it the vast majority comes from when i extend built in html props:
Those built in ones have |
Having the exact same error with anything we export as This is the relevant line: https://github.com/styleguidist/react-docgen-typescript/blob/master/src/parser.ts#L750 Temporary workaround for now was just to disable
|
FYI, did a little further digging here and it seems to be something ( e.g. a quick replace of our e.g. this actually fails (notice additional |
we had the same issue in our storybook project and I could (temporarily) solve it by resetting typescript to |
Ok, I had a quick look into the problem. TScompiler now returns a different (and IMO improved value) from The problem is, that there are several other changes introduced and right now this package is built upon using a locked TS version of If it is OK i would like to take up this task and bump the version and fix all errors that might occur with it, fixing this issue along the line. I would also suggest to improve the The new structure could look something like this: tagMap: {
type: string; // <-- can be one of the `@` types from JSDoc (`@returns`, `@param`, etc)
name?: string; // <-- the parameter name
description?: string; // <-- the parameter description
} |
I noticed this same issue and edited the node_module so I could take a look at {
name: 'see',
text: [
{ text: 'https', kind: 'text' },
{
text: '://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute',
kind: 'text'
}
]
} Which I may have tracked down to this JSDoc tag. https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L1869. I am wondering if this I see on this line (https://github.com/styleguidist/react-docgen-typescript/blob/master/src/parser.ts#L744) that I did some digging into the TS 4.3 update and I wonder if this change (https://devblogs.microsoft.com/typescript/announcing-typescript-4-3/#jsdoc-link-tags) could be involved. The PR (https://github.com/microsoft/TypeScript/pull/41877/files#diff-c989327fa8e0b2f600be4a19bc5b6f2cc2e9d157e8b2b85917645ecfa4df4652R157) for that change mentions changing the way Anyway that is my initial looking around, hopefully helps someone. In our case we have just reverted from TS 4.3 in the interim. |
That definitely helps to understand the reasoning behind the change ... I already found out about the new structure as mentioned above. I am currently looking into solving this. Stay tuned! |
not a fix but downgrading typescript to |
I was having the same issue when upgrading typescript from In my case I'm able to avoid this issue by configuring the plugin to only include my app source code : new ReactDocgenTypescriptPlugin({
include: ['app/javascript/**/*.tsx'],
}) |
In which file is this?
|
|
styleguidist/react-docgen-typescript#356 Storybook builds fail with the latest TypeScript release `4.3.2`. Resolving to an earlier stable release for now.
storybookjs/storybook#15067 styleguidist/react-docgen-typescript#356 Storybook builds fail with the latest TypeScript release `4.3.2`. Resolving to an earlier stable release for now.
* build(deps): bump versions * build(deps): bump versions * disable reactDoggen styleguidist/react-docgen-typescript#356 (comment) * revert typescript bump * fix package lock
Had the same on Storybook 6.2.*, updated to v6.3.7 and the problem is solved! |
Mitigates react-docgen compilation problems styleguidist/react-docgen-typescript#356 (comment)
the latest typescript version is using a 3rd party script that's having some type errors. More info here styleguidist/react-docgen-typescript#356
the latest typescript version is using a 3rd party script that's having some type errors. More info here styleguidist/react-docgen-typescript#356
Still getting this on Disabling it as per @Haraldlons comment still works. |
原因: 1. react-docgen-typescript 依赖不支持 [email protected]+ issue url:styleguidist/react-docgen-typescript#356 2. dumi 暂时没有开放对react-docgen-typescript过滤功能的配置 issue url:umijs/dumi#513
this is woring without change version! Dude you save my day! |
In my case, updating storybook didn't solve this. I have the outdated
You can also try to remove any entry of |
due to "react-docgen-typescript-loader" incompatability see: styleguidist/react-docgen-typescript#356
due to "react-docgen-typescript-loader" incompatability see: styleguidist/react-docgen-typescript#356
@byzg |
is on main.js of storybook |
## Notes - `yarn.lock` has been created from scratch (by removing it before running `yarn`) - Node version update to `14.17` (as same as Electron@13 is using - see https://www.electronjs.org/releases/stable?version=13&page=2#13.0.0) - `.storybook/main.js` defines `reactDocgen: 'react-docgen'` temporary (just as a workaround as mentioned in styleguidist/react-docgen-typescript#356 (comment)) - Upgrades to latest react-chart | [email protected] needs updates for data and style handling for `PoolDetailsChart*.ts` - Stick on `[email protected]` (even a minor update to `@0.39.13` breaks tests - see https://github.com/thorchain/asgardex-electron/pull/1579/checks?check_run_id=2903609210#step:8:27) - Following packages could not be updated (similar issues we had before in thorchain/asgardex-electron#1411) ```bash ncu Checking asgardex-electron/package.json [====================] 105/105 100% @storybook/react ^6.1.21 → ^6.3.0 // breaks build of storybook, it seems babel loader version is not compatible with current CRA (as mentioned in #1411) @types/node ^14.17 → ^15.12 // we stick on [email protected] used by [email protected] ts-loader ^8.3.0 → ^9.2.3 // not compatible w/ webpack <5.0 - see https://github.com/TypeStrong/ts-loader/releases/tag/v9.0.0 cosmos-client ^0.39.2 → ^0.42.5 // `xchain-cosmos` needs to be updated before ethers ^5.1.4 → ^5.3.1 // `xchain-ethereum` needs to be updated before rxjs ^6.6.7 → ^7.1.0 // `fp-ts-rxjs` + `@devexperts/rx-utils/dist/observable.utils` still depends on [email protected] ```
## Notes - `yarn.lock` has been created from scratch (by removing it before running `yarn`) - Node version update to `14.17` (as same as Electron@13 is using - see https://www.electronjs.org/releases/stable?version=13&page=2#13.0.0) - `.storybook/main.js` defines `reactDocgen: 'react-docgen'` temporary (just as a workaround as mentioned in styleguidist/react-docgen-typescript#356 (comment)) - Upgrades to latest react-chart | [email protected] needs updates for data and style handling for `PoolDetailsChart*.ts` - Stick on `[email protected]` (even a minor update to `@0.39.13` breaks tests - see https://github.com/thorchain/asgardex-electron/pull/1579/checks?check_run_id=2903609210#step:8:27) - Following packages could not be updated (similar issues we had before in thorchain/asgardex-electron#1411) ```bash ncu Checking asgardex-electron/package.json [====================] 105/105 100% @storybook/react ^6.1.21 → ^6.3.0 // breaks build of storybook, it seems babel loader version is not compatible with current CRA (as mentioned in #1411) @types/node ^14.17 → ^15.12 // we stick on [email protected] used by [email protected] ts-loader ^8.3.0 → ^9.2.3 // not compatible w/ webpack <5.0 - see https://github.com/TypeStrong/ts-loader/releases/tag/v9.0.0 cosmos-client ^0.39.2 → ^0.42.5 // `xchain-cosmos` needs to be updated before ethers ^5.1.4 → ^5.3.1 // `xchain-ethereum` needs to be updated before rxjs ^6.6.7 → ^7.1.0 // `fp-ts-rxjs` + `@devexperts/rx-utils/dist/observable.utils` still depends on [email protected] ```
We're getting this on
node_modules/react-docgen-typescript/src/parser.ts:750:44
When running
yarn run build-storybook
with the latest typescript
^4.4.0-dev.20210521
, also doesnt work with 4.3The text was updated successfully, but these errors were encountered: