Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Sapper swallows Rollup error locations #1234

Closed
benmccann opened this issue May 26, 2020 · 1 comment · Fixed by #1236
Closed

Sapper swallows Rollup error locations #1234

benmccann opened this issue May 26, 2020 · 1 comment · Fixed by #1236

Comments

@benmccann
Copy link
Member

Describe the bug
Sapper discards the file name, line number, etc. when printing error messages

Logs
Please include browser console and server logs around the time this bug occurred.

To Reproduce

git clone git@github.com:babichjacob/sapper-typescript-graphql-template.git
mv src/service-worker.js src/service-worker.ts
npm install
npm run build

The output does not include a filename or line number:

> @rollup/plugin-typescript TS6133: 'routes' is declared but its value is never read.

Expected behavior

Include the details that are present in the error object:

{"pluginCode":"TS6133","loc":{"column":35,"line":1,"file":"src/service-worker.ts"},"frame":"\n\u001b[7m1\u001b[0m import { timestamp, files, shell, routes } from '@sapper/service-worker';\n\u001b[7m \u001b[0m \u001b[91m                                  ~~~~~~\u001b[0m\n","code":"PLUGIN_ERROR","plugin":"typescript","hook":"buildStart"}

Stacktraces
Sapper does not provide a stack trace. However, on the line below the err object does contain additional details that get discarded at some point.

Information about your Sapper Installation:

  • Sapper version: master

Severity
Critical. Developing an application in Sapper is nearly impossible

Additional context
Please note that this bug has a very different root cause than #1221

I got this when trying to develop a Sapper application based off @babichjacob's TypeScript template

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

Successfully merging a pull request may close this issue.

2 participants