question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transform failed - Expected ";" but found "from"

See original GitHub issue

Describe the bug

Transform failed after running yarn build

Reproduction

https://stackblitz.com/edit/vitejs-vite-dtwytn?terminal=dev

System Info

System:
    OS: macOS 12.5.1
    CPU: (8) arm64 Apple M1
    Memory: 95.75 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.13.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.1.2 - /usr/local/bin/npm
  Browsers:
    Chrome Canary: 107.0.5260.0
    Firefox Developer Edition: 104.0
    Safari: 15.6.1
  npmPackages:
    @vitejs/plugin-vue: ^3.0.3 => 3.0.3 
    vite: ^3.0.9 => 3.0.9

Used Package Manager

yarn

Logs

Click to expand!
  vite:config bundled config file loaded in 39.53ms +0ms
  vite:config using resolved config: {
  vite:config   plugins: [
  vite:config     'vite:build-metadata',
  vite:config     'vite:pre-alias',
  vite:config     'alias',
  vite:config     'vite:modulepreload-polyfill',
  vite:config     'vite:resolve',
  vite:config     'vite:html-inline-proxy',
  vite:config     'vite:css',
  vite:config     'vite:esbuild',
  vite:config     'vite:json',
  vite:config     'vite:wasm-helper',
  vite:config     'vite:worker',
  vite:config     'vite:asset',
  vite:config     'vite:vue',
  vite:config     'vite-plugin-checker',
  vite:config     'vite:wasm-fallback',
  vite:config     'vite:define',
  vite:config     'vite:css-post',
  vite:config     'vite:build-html',
  vite:config     'vite:worker-import-meta-url',
  vite:config     'vite:force-systemjs-wrap-complete',
  vite:config     'vite:watch-package-data',
  vite:config     'commonjs',
  vite:config     'vite:data-uri',
  vite:config     'vite:asset-import-meta-url',
  vite:config     'vite:dynamic-import-vars',
  vite:config     'vite:import-glob',
  vite:config     'gzip',
  vite:config     'vite:build-import-analysis',
  vite:config     'vite:esbuild-transpile',
  vite:config     'vite:terser',
  vite:config     'vite:reporter',
  vite:config     'vite:load-fallback'
  vite:config   ],
  vite:config   resolve: { alias: [ [Object], [Object], [Object] ] },
  vite:config   css: { preprocessorOptions: { scss: [Object] } },
  vite:config   optimizeDeps: {
  vite:config     disabled: 'build',
  vite:config     force: undefined,
  vite:config     esbuildOptions: { preserveSymlinks: undefined }
  vite:config   },
  vite:config   build: {
  vite:config     target: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari13' ],
  vite:config     polyfillModulePreload: true,
  vite:config     outDir: 'dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     cssCodeSplit: true,
  vite:config     cssTarget: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari13' ],
  vite:config     sourcemap: false,
  vite:config     rollupOptions: {},
  vite:config     minify: 'esbuild',
  vite:config     terserOptions: {},
  vite:config     write: true,
  vite:config     emptyOutDir: null,
  vite:config     manifest: false,
  vite:config     lib: false,
  vite:config     ssr: false,
  vite:config     ssrManifest: false,
  vite:config     reportCompressedSize: true,
  vite:config     chunkSizeWarningLimit: 500,
  vite:config     watch: null,
  vite:config     commonjsOptions: { include: [Array], extensions: [Array] },
  vite:config     dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] }
  vite:config   },
  vite:config   define: { __VUE_OPTIONS_API__: true, __VUE_PROD_DEVTOOLS__: false },
  vite:config   ssr: {
  vite:config     format: 'esm',
  vite:config     target: 'node',
  vite:config     external: [],
  vite:config     optimizeDeps: { disabled: true, esbuildOptions: [Object] }
  vite:config   },
  vite:config   configFile: '/Users/enimo/Desktop/Projects/Vengex/new-lah/vite.config.ts',
  vite:config   configFileDependencies: [ '/Users/enimo/Desktop/Projects/Vengex/new-lah/vite.config.ts' ],
  vite:config   inlineConfig: {
  vite:config     root: undefined,
  vite:config     base: undefined,
  vite:config     mode: undefined,
  vite:config     configFile: undefined,
  vite:config     logLevel: undefined,
  vite:config     clearScreen: undefined,
  vite:config     optimizeDeps: { force: undefined },
  vite:config     build: {}
  vite:config   },
  vite:config   root: '/Users/enimo/Desktop/Projects/Vengex/new-lah',
  vite:config   base: '/',
  vite:config   publicDir: '/Users/enimo/Desktop/Projects/Vengex/new-lah/public',
  vite:config   cacheDir: '/Users/enimo/Desktop/Projects/Vengex/new-lah/node_modules/.vite',
  vite:config   command: 'build',
  vite:config   mode: 'production',
  vite:config   isWorker: false,
  vite:config   mainConfig: null,
  vite:config   isProduction: true,
  vite:config   server: {
  vite:config     preTransformRequests: true,
  vite:config     middlewareMode: false,
  vite:config     fs: { strict: true, allow: [Array], deny: [Array] }
  vite:config   },
  vite:config   preview: {
  vite:config     port: undefined,
  vite:config     strictPort: undefined,
  vite:config     host: undefined,
  vite:config     https: undefined,
  vite:config     open: undefined,
  vite:config     proxy: undefined,
  vite:config     cors: undefined,
  vite:config     headers: undefined
  vite:config   },
  vite:config   env: {
  vite:config     VITE_API: 'http://localhost:8000',
  vite:config     VITE_KEY: '',
  vite:config     VITE_DISABLE_TWITCH: 'false',
  vite:config     VITE_ENV: 'DEV',
  vite:config     BASE_URL: '/',
  vite:config     MODE: 'production',
  vite:config     DEV: false,
  vite:config     PROD: true
  vite:config   },
  vite:config   assetsInclude: [Function: assetsInclude],
  vite:config   logger: {
  vite:config     hasWarned: false,
  vite:config     info: [Function: info],
  vite:config     warn: [Function: warn],
  vite:config     warnOnce: [Function: warnOnce],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen],
  vite:config     hasErrorLogged: [Function: hasErrorLogged]
  vite:config   },
  vite:config   packageCache: Map(0) { set: [Function (anonymous)] },
  vite:config   createResolver: [Function: createResolver],
  vite:config   worker: {
  vite:config     format: 'iife',
  vite:config     plugins: [
  vite:config       'vite:build-metadata',
  vite:config       'vite:pre-alias',
  vite:config       'alias',
  vite:config       'vite:modulepreload-polyfill',
  vite:config       'vite:resolve',
  vite:config       'vite:html-inline-proxy',
  vite:config       'vite:css',
  vite:config       'vite:esbuild',
  vite:config       'vite:json',
  vite:config       'vite:wasm-helper',
  vite:config       'vite:worker',
  vite:config       'vite:asset',
  vite:config       'vite:wasm-fallback',
  vite:config       'vite:define',
  vite:config       'vite:css-post',
  vite:config       'vite:build-html',
  vite:config       'vite:worker-import-meta-url',
  vite:config       'vite:force-systemjs-wrap-complete',
  vite:config       'vite:watch-package-data',
  vite:config       'commonjs',
  vite:config       'vite:data-uri',
  vite:config       'vite:asset-import-meta-url',
  vite:config       'vite:dynamic-import-vars',
  vite:config       'vite:import-glob',
  vite:config       'vite:build-import-analysis',
  vite:config       'vite:esbuild-transpile',
  vite:config       'vite:terser',
  vite:config       'vite:reporter',
  vite:config       'vite:load-fallback'
  vite:config     ],
  vite:config     rollupOptions: {}
  vite:config   },
  vite:config   appType: 'spa',
  vite:config   experimental: { importGlobRestoreExtension: false, hmrPartialAccept: false }
  vite:config } +29ms
vite v3.0.9 building for production...
transforming (64) node_modules/@vue/devtools-api/lib/esm/api/api.js  vite:esbuild esbuild error with options used:  {
  sourcemap: true,
  sourcefile: '/Users/enimo/Desktop/Projects/Vengex/new-lah/src/components/InputComp.vue?vue&type=script&setup=true&lang.ts',
  minify: false,
  minifyIdentifiers: false,
  minifySyntax: false,
  minifyWhitespace: false,
  treeShaking: false,
  keepNames: false,
  loader: 'ts',
  tsconfigRaw: {
    compilerOptions: {
      target: 'ESNext',
      useDefineForClassFields: true,
      importsNotUsedAsValues: 'error',
      preserveValueImports: true
    }
  }
} +0ms
  vite:esbuild esbuild error with options used:  {
  sourcemap: true,
  sourcefile: '/Users/enimo/Desktop/Projects/Vengex/new-lah/src/components/ClickableField.vue?vue&type=script&setup=true&lang.ts',
  minify: false,
  minifyIdentifiers: false,
  minifySyntax: false,
  minifyWhitespace: false,
  treeShaking: false,
  keepNames: false,
  loader: 'ts',
  tsconfigRaw: {
    compilerOptions: {
      target: 'ESNext',
      useDefineForClassFields: true,
      importsNotUsedAsValues: 'error',
      preserveValueImports: true
    }
  }
} +1ms
  vite:esbuild esbuild error with options used:  {
  sourcemap: true,
  sourcefile: '/Users/enimo/Desktop/Projects/Vengex/new-lah/src/components/UploaderComp.vue?vue&type=script&setup=true&lang.ts',
  minify: false,
  minifyIdentifiers: false,
  minifySyntax: false,
  minifyWhitespace: false,
  treeShaking: false,
  keepNames: false,
  loader: 'ts',
  tsconfigRaw: {
    compilerOptions: {
      target: 'ESNext',
      useDefineForClassFields: true,
      importsNotUsedAsValues: 'error',
      preserveValueImports: true
    }
  }
} +0ms
  vite:esbuild esbuild error with options used:  {
  sourcemap: true,
  sourcefile: '/Users/enimo/Desktop/Projects/Vengex/new-lah/src/components/TextEditor.vue?vue&type=script&setup=true&lang.ts',
  minify: false,
  minifyIdentifiers: false,
  minifySyntax: false,
  minifyWhitespace: false,
  treeShaking: false,
  keepNames: false,
  loader: 'ts',
  tsconfigRaw: {
    compilerOptions: {
      target: 'ESNext',
      useDefineForClassFields: true,
      importsNotUsedAsValues: 'error',
      preserveValueImports: true
    }
  }
} +0ms
  vite:esbuild esbuild error with options used:  {
  sourcemap: true,
  sourcefile: '/Users/enimo/Desktop/Projects/Vengex/new-lah/src/components/ButtonComp.vue?vue&type=script&setup=true&lang.ts',
  minify: false,
  minifyIdentifiers: false,
  minifySyntax: false,
  minifyWhitespace: false,
  treeShaking: false,
  keepNames: false,
  loader: 'ts',
  tsconfigRaw: {
    compilerOptions: {
      target: 'ESNext',
      useDefineForClassFields: true,
      importsNotUsedAsValues: 'error',
      preserveValueImports: true
    }
  }
} +0ms
✓ 119 modules transformed.
[vite:esbuild] Transform failed with 1 error:
/Users/enimo/Desktop/Projects/Vengex/new-lah/src/components/InputComp.vue?vue&type=script&setup=true&lang.ts:32:31: ERROR: Expected ";" but found "from"
file: /Users/enimo/Desktop/Projects/Vengex/new-lah/src/components/InputComp.vue?vue&type=script&setup=true&lang.ts:32:31

Expected ";" but found "from"
30 |    setup(__props: any, { emit: emits }) {
31 |  
32 |  const props = __props as { 4 } from "uuid";
   |                                 ^
33 |  import { ref, watch , om "vue";
34 |  con, ids = with, typedefinePr }

error during build:
Error: Transform failed with 1 error:
/Users/enimo/Desktop/Projects/Vengex/new-lah/src/components/InputComp.vue?vue&type=script&setup=true&lang.ts:32:31: ERROR: Expected ";" but found "from"
    at failureErrorWithLog (/Users/enimo/Desktop/Projects/Vengex/new-lah/node_modules/esbuild/lib/main.js:1624:15)
    at /Users/enimo/Desktop/Projects/Vengex/new-lah/node_modules/esbuild/lib/main.js:1413:29
    at /Users/enimo/Desktop/Projects/Vengex/new-lah/node_modules/esbuild/lib/main.js:678:9
    at handleIncomingPacket (/Users/enimo/Desktop/Projects/Vengex/new-lah/node_modules/esbuild/lib/main.js:775:9)
    at Socket.readFromStdout (/Users/enimo/Desktop/Projects/Vengex/new-lah/node_modules/esbuild/lib/main.js:644:7)
    at Socket.emit (node:events:390:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:199:23)

Validations

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bluwycommented, Aug 28, 2022

I suppose you mean this component in Stackblitz, and I don’t think the new repro is minimal. It could be further trimmed down on dependencies.

0reactions
vaban-rucommented, Sep 12, 2022

Hello, i have same issue https://github.com/vaban-ru/vue-tsc-reproduction-issue A there any fixes for this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Transform errors: Expected "}" but found ":" · Issue #148 - GitHub
I have recently been trying to integrate remark-shiki-twoslash with Astro and I have been getting some weird errors. Reproduction repo here.
Read more >
Webpack 4, babel 7, react, typescript: Unexpected token ...
Fixed by adding a babel preset: ['@babel/preset-typescript', {allowNamespaces: true}],. I have no clue why react breaks...
Read more >
Runtime Error: expected scalar type Byte but found Float ...
It seems you are passing the inputs as ByteTensors (most likely since you were loading the images as unit8 via OpenCV and might...
Read more >
Expected "XXX" to be a class, but found component instead.
I keep coming across an error of a form "Expected 'XXX' to be a class, but found component instead." when I try to...
Read more >
Why even successful transformations fall short - McKinsey
The newest research from McKinsey confirms that successful organizational transformations still rely on a holistic approach--and still ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found