Skip to content
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

task "teambit.preview/preview:GeneratePreview" has failed #6771

Closed
FIIFE opened this issue Dec 8, 2022 · 2 comments
Closed

task "teambit.preview/preview:GeneratePreview" has failed #6771

FIIFE opened this issue Dec 8, 2022 · 2 comments
Labels

Comments

@FIIFE
Copy link

FIIFE commented Dec 8, 2022

Describe the bug

teambit.preview/preview:GeneratePreview task fails while running bit tag command.
It seems like it's trying to interpret typescript syntax as js and it fails.

According to the following issues:

I tried to solve the problem by:

  • compiling components before tagging
  • reverting bit to version 0.0.867
  • checking my imports whether I import internal files
  • checking whether i don't overwrite TsConfigTransformer and make compiler not generate dist files

Findings

I found out that the capsule of typography component (the one that throws error) is missing the js files in it's dist folder.
If I understand this correctly it's supposed to have these js files and their absence makes it so that the capsule is serving the untranspiled index.ts from the root folder of the package. So If I'm interpreting this correctly then the question is why are these files missing?

Steps to Reproduce

Clone this repo
run bit in, bit compile and bit tag

Expected Behavior

Component is tagged without any errors.

Screenshots, exceptions and logs

bit tag output
⚠ --message will be mandatory in the next few releases. make sure to add a message with your tag
✔ deduping dependencies for installation
✔ running pre install subscribers
...29815c3985cb94128598fe1de1711de9506dc | +174 +++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: /home/fifi/.pnpm-store/v3
  Virtual store is at:             ../../Library/Caches/Bit/capsules/e6b29815c3985cb94128598fe1de1711de9506dc/node_modules/.pnpm
...29815c3985cb94128598fe1de1711de9506dc | Progress: resolved 174, reused 174, downloaded 0, added 174, done
  -------------------------
✔ installing dependencies using pnpm
✔ running post install subscribers
✔ linking components
  running build pipe for 2 environments, total 15 tasks
  generated graph for env "fifi.bit/envs/[email protected]", originalSeedersOfThisEnv: 1, graphOfThisEnv: 2, graph total: 3
  generated graph for env "teambit.envs/env", originalSeedersOfThisEnv: 0, graphOfThisEnv: 1, graph total: 1
✔ executing pre-build for all tasks
✔ env "fifi.bit/envs/[email protected]", task "teambit.harmony/aspect:CoreExporter (export all core aspects via the main aspects)" has completed successfully in 742μs
✔ env "teambit.envs/env", task "teambit.harmony/aspect:CoreExporter (export all core aspects via the main aspects)" has completed successfully in 172μs
✔ env "fifi.bit/envs/[email protected]", task "teambit.compilation/compiler:TSCompiler (compile components for artifact dist)" has completed successfully in 5s
✔ env "teambit.envs/env", task "teambit.compilation/compiler:TSCompiler (compile components for artifact declaration)" has completed successfully in 7ms
✔ env "teambit.envs/env", task "teambit.compilation/compiler:BabelCompiler (compile components for artifact dist)" has completed successfully in 589ms
✔ env "fifi.bit/envs/[email protected]", task "teambit.defender/tester:TestComponents" has completed successfully in 8ms
✔ env "teambit.envs/env", task "teambit.defender/tester:TestComponents" has completed successfully in 681μs
✔ env "fifi.bit/envs/[email protected]", task "teambit.pkg/pkg:PreparePackages" has completed successfully in 5ms
✔ env "fifi.bit/envs/[email protected]", task "teambit.harmony/application:build_application" has completed successfully in 579μs
✔ env "fifi.bit/envs/[email protected]", task "teambit.preview/preview:GenerateEnvTemplate" has completed successfully in 6ms
✖ env: fifi.bit/envs/[email protected], task "teambit.preview/preview:GeneratePreview" has failed
✔ env "teambit.envs/env", task "teambit.pkg/pkg:PreparePackages" has completed successfully in 2ms
✔ env "teambit.envs/env", task "teambit.harmony/application:build_application" has completed successfully in 236μs
✔ env "teambit.envs/env", task "teambit.preview/preview:GenerateEnvTemplate" has completed successfully in 28s
✔ env "teambit.envs/env", task "teambit.preview/preview:GeneratePreview" has completed successfully in 105ms
✔ executing post-build for all tasks
✖ teambit.pipelines/builder, running build pipe for 2 environments, total 15 tasks (completed in 41s)

The following errors were found while running the build pipeline
Failed task 1: "teambit.preview/preview:GeneratePreview" of env "fifi.bit/envs/[email protected]"
component: fifi.ui-library/themes/[email protected]
message: Module build failed (from ../../.bvm/versions/0.0.888/bit-0.0.888/node_modules/babel-loader/lib/index.js):
SyntaxError: /home/fifi/Library/Caches/Bit/capsules/e6b29815c3985cb94128598fe1de1711de9506dc/[email protected]/typography.tsx: Missing semicolon. (6:7)

  4 | import { typographyVariants } from './utils/typographyVariants';
  5 |
> 6 | declare module '@mui/material/styles' {
    |        ^
  7 |   interface TypographyVariants {
  8 |     'DM Serif H1': React.CSSProperties;
  9 |     'DM Serif H2': React.CSSProperties;
    at instantiate (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/@babel/parser/lib/index.js:72:32)
    at constructor (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/@babel/parser/lib/index.js:367:12)
    at JSXParserMixin.raise (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/@babel/parser/lib/index.js:3706:19)
    at JSXParserMixin.semicolon (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/@babel/parser/lib/index.js:4151:10)
    at JSXParserMixin.parseExpressionStatement (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/@babel/parser/lib/index.js:15453:10)
    at JSXParserMixin.parseStatementContent (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/@babel/parser/lib/index.js:14986:19)
    at JSXParserMixin.parseStatement (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/@babel/parser/lib/index.js:14838:17)
    at JSXParserMixin.parseBlockOrModuleBlockBody (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/@babel/parser/lib/index.js:15495:25)
    at JSXParserMixin.parseBlockBody (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/@babel/parser/lib/index.js:15486:10)
    at JSXParserMixin.parseProgram (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/@babel/parser/lib/index.js:14748:10)
    at JSXParserMixin.parseTopLevel (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/@babel/parser/lib/index.js:14735:25)
    at JSXParserMixin.parse (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/@babel/parser/lib/index.js:16764:10)
    at parse (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/@babel/parser/lib/index.js:16816:38)
    at parser (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/@babel/core/lib/parser/index.js:52:34)
    at parser.next (<anonymous>)
    at normalizeFile (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/@babel/core/lib/transformation/normalize-file.js:87:38)
    at normalizeFile.next (<anonymous>)
    at run (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/@babel/core/lib/transformation/index.js:31:50)
    at run.next (<anonymous>)
    at transform (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/@babel/core/lib/transform.js:29:41)
    at transform.next (<anonymous>)
    at step (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/gensync/index.js:261:32)
    at /home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/gensync/index.js:273:13
    at async.call.result.err.err (/home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/gensync/index.js:223:11)
moduleName: ../../Library/Caches/Bit/capsules/e6b29815c3985cb94128598fe1de1711de9506dc/[email protected]/typography.tsx
moduleIdentifier: /home/fifi/.bvm/versions/0.0.888/bit-0.0.888/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[1].oneOf[1]!/home/fifi/Library/Caches/Bit/capsules/e6b29815c3985cb94128598fe1de1711de9506dc/[email protected]/typography.tsx

Found 1 errors in 1 components


✖ Total 15 tasks. 14 succeeded. 1 failed. 0 skipped. Total errors: 1.

Specifications

  • Bit version: 0.0.888
  • Workspace type: I think legacy but I'm not sure (don't know how to check)
  • Node version: 19.1.0
  • npm / yarn version: 8.19.3
  • Platform: WSL 2
  • Bit compiler (include version): 0.0.886
  • Bit tester (include version): 0.0.886
@FIIFE FIIFE added the type/bug label Dec 8, 2022
@benjgil
Copy link
Contributor

benjgil commented Jan 9, 2023

@FIIFE
Do you have a custom ts config in your env?

@FIIFE
Copy link
Author

FIIFE commented Jan 27, 2023

No, at least I don't think I do.
I have everything the same way it is in reproduction repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants