naver / egjs-infinitegrid

A module used to arrange card elements including content infinitely on a grid layout.
https://naver.github.io/egjs-infinitegrid/
MIT License
2.19k stars 94 forks source link

build failed with sveltekit latest version #505

Open kenchan97 opened 2 years ago

kenchan97 commented 2 years ago

Description

After update to latest SvelteKit, and run build , it failed. but npm run dev is fine, i am a backend developer , so not familiar with npm too much.

Here error log from VS file:///C:/Users/LAN/Desktop/Svelte/BBS/.svelte-kit/output/server/entries/pages/HomePage.svelte.js:2 import { Renderer, CONTAINER_CLASS_NAME, INFINITEGRID_METHODS, MasonryInfiniteGrid as MasonryInfiniteGrid$1 } from "@egjs/infinitegrid"; ^^^^^^^^^^^^^^^^^^^^ SyntaxError: Named export 'CONTAINER_CLASS_NAME' not found. The requested module '@egjs/infinitegrid' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using:

import pkg from '@egjs/infinitegrid'; const { Renderer, CONTAINER_CLASS_NAME, INFINITEGRID_METHODS, MasonryInfiniteGrid: MasonryInfiniteGrid$1 } = pkg;

at ModuleJob._instantiate (node:internal/modules/esm/module_job:128:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:194:5)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:409:24)
at async Promise.all (index 0)
at async respond$1 (file:///C:/Users/LAN/Desktop/Svelte/BBS/.svelte-kit/output/server/index.js:1945:13)
at async resolve (file:///C:/Users/LAN/Desktop/Svelte/BBS/.svelte-kit/output/server/index.js:2333:114)
at async respond (file:///C:/Users/LAN/Desktop/Svelte/BBS/.svelte-kit/output/server/index.js:2283:22)
at async visit (file:///C:/Users/LAN/Desktop/Svelte/BBS/node_modules/@sveltejs/kit/dist/prerender.js:626:20)

SyntaxError: Named export 'CONTAINER_CLASS_NAME' not found. The requested module '@egjs/infinitegrid' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using:

import pkg from '@egjs/infinitegrid'; const { Renderer, CONTAINER_CLASS_NAME, INFINITEGRID_METHODS, MasonryInfiniteGrid: MasonryInfiniteGrid$1 } = pkg;

SyntaxError: Named export 'CONTAINER_CLASS_NAME' not found. The requested module '@egjs/infinitegrid' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using:

import pkg from '@egjs/infinitegrid'; const { Renderer, CONTAINER_CLASS_NAME, INFINITEGRID_METHODS, MasonryInfiniteGrid: MasonryInfiniteGrid$1 } = pkg;

SyntaxError: Named export 'CONTAINER_CLASS_NAME' not found. The requested module '@egjs/infinitegrid' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using:

import pkg from '@egjs/infinitegrid'; const { Renderer, CONTAINER_CLASS_NAME, INFINITEGRID_METHODS, MasonryInfiniteGrid: MasonryInfiniteGrid$1 } = pkg;

SyntaxError: Named export 'CONTAINER_CLASS_NAME' not found. The requested module '@egjs/infinitegrid' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using:

import pkg from '@egjs/infinitegrid'; const { Renderer, CONTAINER_CLASS_NAME, INFINITEGRID_METHODS, MasonryInfiniteGrid: MasonryInfiniteGrid$1 } = pkg;

SyntaxError: Named export 'CONTAINER_CLASS_NAME' not found. The requested module '@egjs/infinitegrid' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using:

import pkg from '@egjs/infinitegrid'; const { Renderer, CONTAINER_CLASS_NAME, INFINITEGRID_METHODS, MasonryInfiniteGrid: MasonryInfiniteGrid$1 } = pkg;

file:///C:/Users/LAN/Desktop/Svelte/BBS/node_modules/@sveltejs/kit/dist/prerender.js:460 throw new Error(format_error(details, config)); ^

Error: 500 / at file:///C:/Users/LAN/Desktop/Svelte/BBS/node_modules/@sveltejs/kit/dist/prerender.js:460:11 at save (file:///C:/Users/LAN/Desktop/Svelte/BBS/node_modules/@sveltejs/kit/dist/prerender.js:744:4) at visit (file:///C:/Users/LAN/Desktop/Svelte/BBS/node_modules/@sveltejs/kit/dist/prerender.js:635:3)

Steps to check or reproduce

update to latest Sveltekit with static adapter and npm run build

daybrush commented 2 years ago

@kenchan97

Try @egjs/svelte-infinitegrid@4.6.1-beta.0 version.

Thank you :)

GrassHopper42 commented 2 years ago

@kenchan97

Try @egjs/svelte-infinitegrid@4.6.1-beta.0 version.

Thank you :)

I tried, but there is nothing to change in result

daybrush commented 2 years ago

@GrassHopper42

Try @egjs/svelte-infinitegrid@4.6.1-beta.1 version.

Thank you

GrassHopper42 commented 2 years ago

@GrassHopper42

Try @egjs/svelte-infinitegrid@4.6.1-beta.1 version.

Thank you

It works! Thank you!!!!!!

daybrush commented 1 year ago

@GrassHopper42

Updated to the latest version

kenchan97 commented 1 year ago

thank your response