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 "/.../...svelte" points to missing source files (if empty script tag) #2029

Closed
iocron opened this issue Jul 28, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@iocron
Copy link

iocron commented Jul 28, 2021

Describe the bug

Warning/Error Message "Sourcemap for /.../...svelte points to missing source files" happens on a simple import in __layout.svelte, as long as the file contains only content, but if there is a <script> tag with code (e.g. <script>abc=123</script>), then the error message doesn't appear.

Reproduction

Add the following to __layout.svelte:

<script>
import Footer from '$lib/footer/Footer.svelte';
</script>

<Footer />

and create the file lib/footer/Footer.svelte without any script tag and only text, e.g.: abc

Run npm run dev

Logs

No response

System Info

System:
    OS: Linux 5.10 Ubuntu 20.04.2 LTS (Focal Fossa)
    CPU: (4) x64 AMD Ryzen 7 4800H with Radeon Graphics
    Memory: 121.87 MB / 1.94 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 14.17.3 - ~/.nvm/versions/node/v14.17.3/bin/node
    Yarn: 1.22.11 - ~/.nvm/versions/node/v14.17.3/bin/yarn
    npm: 7.20.1 - ~/.nvm/versions/node/v14.17.3/bin/npm
  Browsers:
    Chrome: 90.0.4430.212
  npmPackages:
    @sveltejs/kit: next => 1.0.0-next.138
    svelte: ^3.34.0 => 3.41.0

Severity

annoyance

Additional Information

No response

@dominikg
Copy link
Member

additional context: #2001

@benmccann
Copy link
Member

benmccann commented Jul 28, 2021

Here's the warning I get:

Sourcemap for "src/routes/index.svelte" points to missing source files
Sourcemap for ".svelte-kit/dev/components/layout.svelte" points to missing source files

Here's the sourcemap definitions:

SourceMap {
  version: 3,
  mappings: ';;;;;;;;',
  names: [],
  sources: [ 'src/routes/index.svelte' ]
}
SourceMap {
  version: 3,
  mappings: ';;;;;;;',
  names: [],
  sources: [ '.svelte-kit/dev/components/layout.svelte' ]
}

Those files definitely exist. This seems like a Vite bug: vitejs/vite#4423

@benmccann
Copy link
Member

this should be fixed the next time a release of svelte is cut: sveltejs/svelte#6598

@benmccann benmccann removed the vite label Aug 4, 2021
@jdgamble555
Copy link

The error is back in v1.0.0-next.310

@dominikg
Copy link
Member

dominikg commented Apr 9, 2022

caused by sourcemaps created by svelte-preprocess, fix pending here sveltejs/svelte-preprocess#500

@jaskaransarkaria
Copy link

jaskaransarkaria commented Apr 11, 2022

I have the error too, not sure how to fix this:

The request url "/home/jaskaran/repos/website/static/fonts/CaviarDreams.ttf" is outside of Vite serving allow list.

- /home/jaskaran/repos/website/src/lib
- /home/jaskaran/repos/website/src/routes
- /home/jaskaran/repos/website/.svelte-kit
- /home/jaskaran/repos/website/src
- /home/jaskaran/repos/website/node_modules

Refer to docs https://vitejs.dev/config/#server-fs-allow for configurations and more details.

The request url "/home/jaskaran/repos/website/static/fonts/regular.ttf" is outside of Vite serving allow list.
Sourcemap for "/home/jaskaran/repos/website/src/routes/__layout.svelte" points to missing source files
Sourcemap for "/home/jaskaran/repos/website/src/routes/index.svelte" points to missing source files

I solved this by pinning:

    "@sveltejs/kit": "1.0.0-next.304",
    "@sveltejs/vite-plugin-svelte": "1.0.0-next.40",

And also pinning vite, which was the real culprit for me:

  "overrides": {
    "@sveltejs/vite-plugin-svelte": "1.0.0-next.40",
    "vite": "2.7.1"
  }

@dummdidumm
Copy link
Member

Please install the latest version of svelte-preprocess which hopefully fixes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants