-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Lodash import issue in v4 #9388
Copy link
Copy link
Closed
vitejs/vite
#15307Labels
ecosystem: upstreamUpstream package has issueUpstream package has issue
Description
Astro Info
Astro v4.0.3
Node v18.16.1
System Windows (x64)
Package Manager npm
Output static
Adapter none
Integrations @astrojs/react
@astrojs/tailwind
If this issue only occurs in one browser, which browser is a problem?
All browsers
Describe the Bug
Updated astro to v4, run the project, got an immediate error :
TypeError: __vite_ssr_import_0__.isObject is not a function
isObject being imported through
import { isObject } from "lodash";
I also tried to remove node_modules and package-lock and reinstalling, same result. Also tried a new project, same result. Then tried on stackblitz, same result.
I tried to add lodash to my astro.config.mjs as such :
export default defineConfig({
integrations: [react(), tailwind()],
vite: {
ssr: {
external: ["lodash"]
}
}
});
No idea if that's supposed to work as I never dwelved into vite before.
Of course lodash is properly referenced in my package.json file and present in node_modules.
{
"dependencies": {
"lodash": "^4.17.21",
}
}
Also :
PS G:\fo> npm list lodash
[email protected] G:\fo
└── [email protected]
What's the expected result?
I expect it to work properly.
Link to Minimal Reproducible Example
Participation
- I am willing to submit a pull request for this issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ecosystem: upstreamUpstream package has issueUpstream package has issue