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

Sourcemap for "X.ts" points to missing source files #7558

Closed
michealroberts opened this issue Apr 1, 2022 · 11 comments
Closed

Sourcemap for "X.ts" points to missing source files #7558

michealroberts opened this issue Apr 1, 2022 · 11 comments

Comments

@michealroberts
Copy link

Describe the bug

I currently have the following configuration for my Vite & Vue.js project:

import { defineConfig } from 'vite'

import vue from '@vitejs/plugin-vue'
import WindiCSS from 'vite-plugin-windicss'

import typescript from '@rollup/plugin-typescript'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    // https://github.com/antfu/vite-plugin-windicss
    WindiCSS({
      safelist: '',
    }),
    typescript({
        tsconfig: './tsconfig.json'
    }),
    vue()
  ]
})

And on running the following command:

npm run dev -- --host --port 8099

And navigating to localhost:8099 in the browser I am seeing these errors:

Sourcemap for "/Users/michael/Developer/observerly/aestrium/src/main.ts" points to missing source files
Sourcemap for "/Users/michael/Developer/observerly/aestrium/src/components/index.ts" points to missing source files
Sourcemap for "/Users/michael/Developer/observerly/aestrium/src/composables/index.ts" points to missing source files
Sourcemap for "/Users/michael/Developer/observerly/aestrium/src/composables/useAdjustedScreen/index.ts" points to missing source files
Sourcemap for "/Users/michael/Developer/observerly/aestrium/src/composables/useCanvas/index.ts" points to missing source files
Sourcemap for "/Users/michael/Developer/observerly/aestrium/src/composables/useDimensions/index.ts" points to missing source files
Sourcemap for "/Users/michael/Developer/observerly/aestrium/src/composables/useCardinals/index.ts" points to missing source files
Sourcemap for "/Users/michael/Developer/observerly/aestrium/src/composables/useEcliptic/index.ts" points to missing source files
Sourcemap for "/Users/michael/Developer/observerly/aestrium/src/composables/useInteractions/index.ts" points to missing source files
Sourcemap for "/Users/michael/Developer/observerly/aestrium/src/composables/useConstellations/index.ts" points to missing source files
Sourcemap for "/Users/michael/Developer/observerly/aestrium/src/composables/useMoon/index.ts" points to missing source files
Sourcemap for "/Users/michael/Developer/observerly/aestrium/src/utils/index.ts" points to missing source files
Sourcemap for "/Users/michael/Developer/observerly/aestrium/src/composables/useStars/index.ts" points to missing source files
Sourcemap for "/Users/michael/Developer/observerly/aestrium/src/composables/useSun/index.ts" points to missing source files
Sourcemap for "/Users/michael/Developer/observerly/aestrium/src/utils/canvas.ts" points to missing source files
Sourcemap for "/Users/michael/Developer/observerly/aestrium/src/utils/intersectDistance.ts" points to missing source files

Although the app works 100% fine, I believe these are just warnings.

I've looked through the documentation as to why this could be happening, but nothing suggests why. There is a build.sourcemap flag I could add, but no dev.sourcemap (a similar one exists for CSS css.devSourcemap) ...

Reproduction

https://github.com/observerly/aestrium

System Info

System:
    OS: macOS 12.2.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 894.11 MB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.6.0 - /usr/local/bin/node
    npm: 8.5.3 - /usr/local/bin/npm
  Browsers:
    Chrome: 100.0.4896.60
    Firefox: 98.0.2
    Firefox Developer Edition: 99.0
    Safari: 15.3
  npmPackages:
    @vitejs/plugin-vue: ^2.3.1 => 2.3.1 
    vite: ^2.9.1 => 2.9.1


### Used Package Manager

npm

### Logs

```shell
> vue-tsc --noEmit && vite build "--debug"

  vite:config bundled config file loaded in 242.30ms +0ms
  vite:config using resolved config: {
  vite:config   plugins: [
  vite:config     'vite:build-metadata',
  vite:config     'alias',
  vite:config     'vite-plugin-windicss:alias',
  vite:config     'vite-plugin-windicss:groups',
  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',
  vite:config     'vite:worker',
  vite:config     'vite:asset',
  vite:config     'vite-plugin-windicss',
  vite:config     'vite-plugin-windicss:css',
  vite:config     'vite-plugin-windicss:css:svelte',
  vite:config     'vite-plugin-windicss:devtools',
  vite:config     'typescript',
  vite:config     'vite:vue',
  vite:config     'vite:define',
  vite:config     'vite:css-post',
  vite:config     'vite:build-html',
  vite:config     'vite:worker-import-meta-url',
  vite:config     'vite:watch-package-data',
  vite:config     'commonjs',
  vite:config     'vite:data-uri',
  vite:config     'rollup-plugin-dynamic-import-variables',
  vite:config     'vite:asset-import-meta-url',
  vite:config     'vite-plugin-windicss:entry',
  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   build: {
  vite:config     target: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
  vite:config     polyfillModulePreload: true,
  vite:config     outDir: 'dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     cssCodeSplit: true,
  vite:config     cssTarget: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
  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: { external: [ 'vue', '@vue/server-renderer' ] },
  vite:config   configFile: '/Users/michael/Developer/observerly/aestrium/vite.config.ts',
  vite:config   configFileDependencies: [ '/Users/michael/Developer/observerly/aestrium/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     build: {}
  vite:config   },
  vite:config   root: '/Users/michael/Developer/observerly/aestrium',
  vite:config   base: '/',
  vite:config   resolve: { dedupe: undefined, alias: [ [Object], [Object] ] },
  vite:config   publicDir: '/Users/michael/Developer/observerly/aestrium/public',
  vite:config   cacheDir: '/Users/michael/Developer/observerly/aestrium/node_modules/.vite',
  vite:config   command: 'build',
  vite:config   mode: 'production',
  vite:config   isWorker: false,
  vite:config   isProduction: true,
  vite:config   server: {
  vite:config     preTransformRequests: true,
  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: { BASE_URL: '/', MODE: 'production', DEV: false, PROD: true },
  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   optimizeDeps: {
  vite:config     esbuildOptions: { keepNames: undefined, preserveSymlinks: undefined }
  vite:config   },
  vite:config   worker: {
  vite:config     format: 'iife',
  vite:config     plugins: [
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object]
  vite:config     ],
  vite:config     rollupOptions: {}
  vite:config   }
  vite:config } +120ms
vite v2.9.1 building for production...
✓ 35 modules transformed.
[plugin:typescript] @rollup/plugin-typescript: Rollup 'sourcemap' option must be set to generate source maps.
dist/src/index.d.ts                                 0.11 KiB
dist/src/main.d.ts                                  0.03 KiB
dist/src/components/index.d.ts                      0.07 KiB
dist/src/components/SkyViewer/SkyViewer.d.ts        0.10 KiB
dist/src/composables/index.d.ts                     1.08 KiB
dist/src/composables/useAdjustedScreen/index.d.ts   0.10 KiB
dist/src/composables/useCanvas/index.d.ts           1.07 KiB
dist/src/composables/useCardinals/index.d.ts        1.48 KiB
dist/src/composables/useConstellations/index.d.ts   1.92 KiB
dist/src/composables/useDimensions/index.d.ts       0.46 KiB
dist/src/composables/useEcliptic/index.d.ts         1.64 KiB
dist/src/composables/useInteractions/index.d.ts     0.76 KiB
dist/src/composables/useMoon/index.d.ts             1.81 KiB
dist/src/composables/useStars/index.d.ts            2.16 KiB
dist/src/composables/useSun/index.d.ts              1.69 KiB
dist/src/types/index.d.ts                           0.07 KiB
dist/src/types/SkyViewer/index.d.ts                 1.65 KiB
dist/src/utils/canvas.d.ts                          0.92 KiB
dist/src/utils/index.d.ts                           0.12 KiB
dist/src/utils/intersectDistance.d.ts               0.37 KiB
dist/index.html                                     0.44 KiB
dist/assets/index.efebb9d2.css                      1.77 KiB / gzip: 0.83 KiB
dist/assets/index.9e05da30.js                       343.63 KiB / gzip: 96.98 KiB


### Validations

- [X] Follow our [Code of Conduct](https://github.com/vitejs/vite/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://vitejs.dev/guide).
- [X] Check that there isn't [already an issue](https://github.com/vitejs/vite/issues) that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vitejs/vite/discussions) or join our [Discord Chat Server](https://chat.vitejs.dev/).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
@michealroberts
Copy link
Author

Is this related to the following PR: PR 7442 ? I have recently updated to the most recent version but I am guessing these changes haven't been added to a release yet?

@sapphi-red
Copy link
Member

Your reproduction links to 404. It seems it is a private repository.

@michealroberts
Copy link
Author

Your reproduction links to 404. It seems it is a private repository.

Let me know if you want access to it I can add you as temp maintainer.

@sapphi-red
Copy link
Member

If it is not a minimal reproducible example, could you create it?

@michealroberts
Copy link
Author

If it is not a minimal reproducible example, could you create it?

It's a maximum reproducible example ... i.e., the actual code base with the error.

@github-actions
Copy link

github-actions bot commented Apr 1, 2022

Hello @michael-observerly. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

@bluwy
Copy link
Member

bluwy commented Apr 1, 2022

@michael-observerly We need a minimal repro so that it's simpler to debug what causes the issue. A full scale app as a repro could introduce a lot of places to look for, making it hard to resolve the issue.

@michealroberts
Copy link
Author

@bluwy Ok, I will get a MRE to you. However, there is no Vite + Vue 3 project on Stackblitz out of the box ... do you know of a stable fork to share for Vite version 2.9.1?

@michealroberts
Copy link
Author

michealroberts commented Apr 1, 2022

@bluwy Would you be happy if I started from a template I've just created: https://stackblitz.com/edit/52908eea-914c-4188-9920-784a3a0d8eb3-du2mmh

@bluwy
Copy link
Member

bluwy commented Apr 1, 2022

The template looks good to me. There is a Vite + Vue 3 template though:

Screenshot 2022-04-01 at 9 45 06 PM

@michealroberts
Copy link
Author

michealroberts commented Apr 1, 2022

Closing this issue as setting the sourceMap flag in tsconfig.json seems to remove the error:

{
    "compilerOptions": {
       "sourceMap": false,
    }
}

@github-actions github-actions bot locked and limited conversation to collaborators Apr 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants