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.

[BUG] Disconcerting warnings and errors in blank Typescript template

See original GitHub issue

Bug Report Quick Checklist

  • I am on the latest version of Snowpack & all plugins. (3.3.4)
  • I use package manager yarn (Fill in: npm, yarn, pnpm, etc).
  • I run Snowpack on OS macOS (Fill in: Windows, Mac, Linux, etc).
  • I run Snowpack on Node.js v12+ (14.8.0)

Describe the bug

The blank Typescript template gives several warnings/error messages. This is disconcerting for people who are new to Snowpack, and just trying it out…

To Reproduce

Read the README.md for details, but the outline is:

  1. npx create-snowpack-app test26mar --template @snowpack/app-template-blank-typescript --use-yarn
  2. see several deprecation warnings…
  3. s/3.0.1/3.3.4/ in package.json
  4. Deprecations go away when re-running yarn
  5. yarn start gives a Rollup preventAssignment error even though Rollup is not (obviously) being used

Expected behavior

No errors or warnings from the npx or yarn start commands

Anything else?

Demo repo and README.md at: https://github.com/richb-hanover/SnowpackTest-26Apr

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
richb-hanovercommented, Apr 29, 2021

Thank you for tracking all these items down. I appreciate that effort. Your analysis makes sense

I am enough of a “techie” to see the power of Snowpack. And I can muddle through. But I also remain a “naive user”, and see the bumps along the road - these will slow its adoption. (That’s why I put “Disconcerting warnings…” in the title. They’re not necessarily bugs, but they make a newcomer wonder if something bad happened, or if, perhaps, the whole project is unreliable.)

I can see you’re deeply knowledgeable about the Javascript ecosystem and with the Snowpack environment. But it would take me far longer to reach those same conclusions. (And longer, still, to actually make any PRs.)

So I point out these problems a) to ask if I’m “doing it wrong” or b) to show where Snowpack could be improved. Is there a better (more helpful) place to make these observations? Could these reports be improved?

Many thanks.

1reaction
richb-hanovercommented, Apr 28, 2021

The logs are in the README at: https://github.com/richb-hanover/SnowpackTest-26Apr and reproduced here…

Starting new Snowpack project

  • On 26 Apr 2021, use npx with a blank typescript template to create new project.

  • By default, this installs Snowpack 3.0.1. This generates the deprecated warnings (below).

  • Manually changing to Snowpack 3.3.4 in the package.json file removes these warnings. The project seems to run fine.

  • Using yarn start, see the second set (below) of Rollup warnings about preventAssignment even though the project doesn’t use Rollup.

√ github % npx create-snowpack-app test26mar --template @snowpack/app-template-blank-typescript --use-yarn
npx: installed 24 in 2.795s

  - Using template @snowpack/app-template-blank-typescript
  - Creating a new project in /Users/richb/github/test26mar
  - Installing package dependencies. This might take a couple of minutes.

warning package.json: No license field
warning ../package.json: No license field
warning No license field
warning snowpack > rollup > fsevents@2.1.3: "Please update to latest v2.3 or v2.2"
warning snowpack > pacote > @npmcli/run-script > node-gyp > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning snowpack > pacote > @npmcli/run-script > node-gyp > request > har-validator@5.1.5: this library is no longer supported

  - Initializing git repo.

  - Success!

Quickstart:

  cd test26mar
  yarn start

All Commands:

  yarn install     Install your dependencies. (We already ran this one for you!)
  yarn start       Start your development server.
  yarn run build   Build your website for production.
  yarn test        Run your tests.

Error on initial start

√ test26mar % yarn start
yarn run v1.22.10
warning package.json: No license field
warning ../package.json: No license field
$ snowpack dev
[22:14:17] [snowpack] Welcome to Snowpack! Because this is your first time running
this project, Snowpack needs to prepare your dependencies. This is a one-time step
and the results will be cached for the lifetime of your project. Please wait...
[22:14:17] [snowpack] + canvas-confetti@1.4.0
[22:14:17] [esinstall:canvas-confetti] @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
[22:14:17] [snowpack] Ready!
[22:14:17] [snowpack] Server started in 16ms.
[22:14:17] [snowpack] Local: http://localhost:8080
[22:14:17] [snowpack] Network: http://192.168.253.116:8080
[22:14:18] [@snowpack/plugin-typescript] 9:13:18 PM - Starting compilation in watch mode...
[22:14:19] [@snowpack/plugin-typescript] 9:13:19 PM - Found 0 errors. Watching for file changes.
⠏ watching for file changes...^C
Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] Disconcerting warnings and errors in blank Typescript ...
The blank Typescript template gives several warnings/error messages. This is disconcerting for people who are new to Snowpack, ...
Read more >
TypeScript errors and how to fix them
Common Errors​​ Below you find a list of common TypeScript errors along with the buggy code and its fixed version.
Read more >
How to get rid of the warning .ts file is part of the TypeScript ...
app.json, and I would receive the error message for just about every new .ts file I added to the project. Explicitly adding the...
Read more >
Improving TypeScript error handling with exhaustive type ...
Discover an improved method for handling errors in TypeScript that solves problems that arise from returning null and throwing try...catch.
Read more >
Page 7 – All views and opinions are ... - Hosk's Dynamic Blog
Projects are a good example of past best practices being used. ... To diagnose an error, look at the error with an empty...
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