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: Using chakra causes `snowpack dev` to take 42 seconds

See original GitHub issue

Quick checklist

  • I am using the latest version of Snowpack and all plugins.

What package manager are you using?

npm

What operating system are you using?

Windows

Describe the bug

snowpack dev takes 90 seconds when warmed up. (42 in the below demo app).

This is reproducible on 2 separate people and machines.

Guessing this is more of the way Chakra is organised, but would consider this a bug considering it takes so long, and the output says server started in 38ms. Feel like I’ve been lied to!

Steps to reproduce

  1. npx create-snowpack-app using template @snowpack/app-template-react-typescript
  2. Install chakra: npm i @chakra-ui/react @emotion/react@^11 @emotion/styled@^11 framer-motion@^4
  3. Change App.tsx to use chakra:
import React from 'react';
import {
  Center,
  ChakraProvider,
  CSSReset,
  extendTheme,
} from '@chakra-ui/react';

interface AppProps {}

const theme = extendTheme({
  components: {
    Button: {
      baseStyle: {
        _focus: {
          boxShadow: 'none',
        },
      },
    },
  },
});

function App({}: AppProps) {
  return (
    <ChakraProvider theme={theme}>
      <CSSReset />
      <Center height="100vh"></Center>
    </ChakraProvider>
  );
}

export default App;
  1. Run npm start takes 73s to run cold:
PS C:\src\snowpack-chakra-slow-test> get-date; npm start

03 July 2021 23:06:26

> start
> snowpack dev

[24:07:28] [snowpack] + @chakra-ui/react@1.6.4
[24:07:28] [snowpack] └── @chakra-ui/css-reset@1.0.0
[24:07:28] [snowpack]   └── @emotion/react@11.4.0
[24:07:29] [snowpack]     └── react@17.0.2 (dedupe)
 -- 7000 similar lines like previous 3, going through dep tree
[24:08:39] [snowpack] Ready!
[24:08:39] [snowpack] Server started in 50ms.
[24:08:39] [snowpack] Local: http://localhost:8080
[24:08:39] [snowpack] Network: http://172.17.48.1:8080
[24:08:39] [@snowpack/plugin-typescript] 23:07:39 - Starting compilation in watch mode...
[24:08:44] [@snowpack/plugin-typescript] 23:07:44 - Found 0 errors. Watching for file changes.

Not sure why Snowpack increments hour and minute by 1 😂 🤷‍♂️

  1. run npm start again (warm) takes 42 seconds. In our actual project takes about 90 seconds, as we have a plethora of other packages installed)
PS C:\src\snowpack-chakra-slow-test> get-date;npm start

03 July 2021 23:19:13

> start
> snowpack dev

[24:20:55] [snowpack] Ready!
[24:20:55] [snowpack] Server started in 38ms.
[24:20:55] [snowpack] Local: http://localhost:8080
[24:20:55] [snowpack] Network: http://172.17.48.1:8080
[24:20:55] [@snowpack/plugin-typescript] 23:19:55 - Starting compilation in watch mode...
[24:21:00] [@snowpack/plugin-typescript] 23:20:00 - Found 0 errors. Watching for file changes.

This is on a decentish speced laptop (albeit 2/3 years old)

Operating System: Windows 10 Pro 64-bit (10.0, Build 19043) (19041.vb_release.191206-1406)
System Manufacturer: HP
System Model: HP Spectre x360 Convertible 15-ch0xx
Processor: Intel(R) Core(TM) i7-8705G CPU @ 3.10GHz (8 CPUs), ~3.1GHz

Link to minimal reproducible example (optional)

michal-ciechan/snowpack-chakra-slow-test: Example of snowpack slowness with chakra

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

2reactions
drwpowcommented, Jul 8, 2021

Thanks for filing. We’re working on some improvements to esinstall (the package that does all the preparation that takes so long) that should speed this up drastically.

0reactions
drwpowcommented, Aug 24, 2021

Thanks for your patience. In the recent snowpack@3.8.7 release, startup times across the board have improved. I’m seeing ~15 second cold start on my machine for @chakra-ui/react and all deps, with subsequent startups being instant, of course.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Untitled
Mirages are caused by, Peliculas mexicanas en japon! ... Ice age wallpaper 4, Use inconstant in a sentence, Pachelbel canon in g piano,...
Read more >
@mui/utils | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
wRD - River Thames Conditions
Chem 7 diagram fishbone, Geometra walter sartori, Quality control uses, ... Adresa router linksys, Kamerzysta wesele lomza, Hochu viagry, Bugs bunny and ...
Read more >
mn 0 01 05_1 1 10 100 10th 11 11_d0003 12 13 14 141a
... 30 3000d_11 31 32 33 34 35 36 3600 3603 3670 37 38 39 3rd 4 40 41 42 43 4341 44...
Read more >
736 kB - Hugging Face
1 ·where 1 ·way 1 ·make 1 ·being 1 ·going 1 ·down 1 ·any 1 ... 1 ·challenged 1 ·Use 1 ·formation 1...
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