ThatsTasty
04/19/2023, 7:20 PMkian
04/19/2023, 7:27 PMnpm i package
and then import { foo } from "package"
as you'd expectThatsTasty
04/19/2023, 7:31 PMThatsTasty
04/19/2023, 7:32 PMnpm i
in the src subfolder?ThatsTasty
04/19/2023, 7:34 PMsrc/index.js:1:20:
1 │ let probe = require("probe-image-size");
╵ ~~~~~~~~~~~~~~~~~~
The Yarn Plug'n'Play manifest forbids importing "probe-image-size" here because it's not listed as a dependency of this package:
../../../.pnp.js:47:33:
47 │ "packageDependencies": [
╵ ^
You can mark the path "probe-image-size" as external to exclude it from the bundle, which will remove this error. You can also surround this "require" call with a try/catch block to handle this failure at run-time instead of bundle-time.
✘ [ERROR] Build failed with 1 error:
src/index.js:1:20: ERROR: Could not resolve "probe-image-size"
ThatsTasty
04/19/2023, 7:48 PM