#3785·snowpack

BUG: Wrong versions of packages in build cache leading to build failures

Author: aventideCreated Oct 24, 2021Updated Nov 2, 2022

Quick checklist

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

What package manager are you using?

npm node 16.12.0

What operating system are you using?

macOS

Describe the bug

When trying to do a React project build with snowpack, I get a build failure when I attempt to import and render any components from @inlet/react-pixi.

[23:30:24] [snowpack] ENOENT: no such file or directory, open '/Users/alex/Dev/octagon-board-test/node_modules/.cache/snowpack/build/[email protected]/eventemitter3.js'

When inspecting the .cache/snowpack/build directory, I see a directory named [email protected]

When attempting to manually edit the directory name to force a match, I then get a similar problem with the version of punycode, and manually editing the name doesn't get me anywhere. At this point, I'm not sure why the build cache versions aren't matching what's expected by snowpack.

I will update with an example if it turns out this is an interesting problem and not me being dumb somehow. But following my instruction should get you an example pretty quickly.

Thanks for any advice on this!

Steps to reproduce

  1. Follow the snowpack react tutorial (https://www.snowpack.dev/tutorials/react) to get a skeleton project that can render a React component.

  2. In the root component (say, App.js), use this code:

bash
import React from 'react';
import { Stage, Sprite } from '@inlet/react-pixi';

export default function App() {
    return <Stage>
        <Sprite image="https://s3-us-west-2.amazonaws.com/s.cdpn.io/693612/IaUrttj.png" x={100} y={100} />
    </Stage>
};
  1. Run npm start

Note: react-pixi works fine in create-react-app, which leads me to believe it's a snowpack issue.

Link to minimal reproducible example (optional)

No response