_ is not defined #606
Answered
by
frehner
DaveAllbirds
asked this question in
Help
_ is not defined
#606
-
Trying out the import {sum} from 'lodash';
export async function loader({params, request, context}) {
const testLodash = sum([1, 2, 3, 4, 5]);
... ReferenceError: _ is not defined.
Attempted to access binding using global in modules.
You must use the 2nd `env` parameter passed to exported handlers/Durable Object constructors, or `context.env` with Pages Functions.
at EventTarget.get (~/work/demo-store/node_modules/@miniflare/core/src/standards/event.ts:291:19) Surprised that this hasn't been brought up seeing as it's such a popular library. Is there a solution for this scenario when running the dev miniflare env? |
Beta Was this translation helpful? Give feedback.
Answered by
frehner
Mar 1, 2023
Replies: 1 comment 2 replies
-
Hm, does using |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
DaveAllbirds
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hm, does using
lodash-es
work?https://www.npmjs.com/package/lodash-es