Getting TypeError: Cannot read properties of undefined (reading 'getFullText') when building #909
Replies: 2 comments
-
I faced the same issue. Did you find solution? |
Beta Was this translation helpful? Give feedback.
-
I realise this is quite an old issue now, but for anybody else encountering this I found what was the cause (at least for me). Circular Dependencies may be the main cause here. In summary that means you have two modules (A and B) when Module A imports Module B and Module B imports Module A. When bundling this won't actually throw an error until you try to use the library. I used dpmd to analyse circular dependencies in my code with the following command. "detect-circular-deps": "dpdm --no-warning --no-tree --exit-code circular:1 src/index.ts" I suggest putting "npm run detect-circular-deps" in your package.json "prebuild" and/or "prepack" scripts. A common cause of circular dependencies is when using a barrel import system (exporting all modules within a directory from index.js / index.ts). |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am using tsup to build a ts libary within a turborepo monorepo.
When I run
tsup
to build I am getting the errorTypeError: Cannot read properties of undefined (reading 'getFullText')
which is at ${path to node_modules}/tsup/dist/rollup.js:7415
The rollup version installed in the repo is
"rollup": "^3.2.5",
Has anyone else had similar errors and maybe a solution?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions