RiadhAdrani / slick-portfolio-svelte

Vercel-like style portfolio template for developers.
https://riadhadrani.github.io/slick-portfolio-svelte/
196 stars 99 forks source link

Erro while building the protfolio with npm run build #26

Closed Srm-Akla closed 8 months ago

Srm-Akla commented 8 months ago

Hi, I was trying to build with npm build such that i can preview. I have tried npm run preview as well, both result in the same problem.

Link to my repo: https://github.com/Srm-Akla/srm-akla.github.io

TypeError: Cannot read properties of undefined (reading 'light')
    at getAssetURL (file:///home/zippidybop/Projects/srm-akla.github.io/.svelte-kit/output/server/chunks/skills.params.js:78:80)
    at file:///home/zippidybop/Projects/srm-akla.github.io/.svelte-kit/output/server/entries/pages/_page.svelte.js:15:129
    at each (file:///home/zippidybop/Projects/srm-akla.github.io/.svelte-kit/output/server/chunks/index2.js:94:12)
    at file:///home/zippidybop/Projects/srm-akla.github.io/.svelte-kit/output/server/entries/pages/_page.svelte.js:14:93
    at Object.$$render (file:///home/zippidybop/Projects/srm-akla.github.io/.svelte-kit/output/server/chunks/index2.js:123:18)
    at file:///home/zippidybop/Projects/srm-akla.github.io/.svelte-kit/output/server/entries/pages/_page.svelte.js:68:47
    at Object.$$render (file:///home/zippidybop/Projects/srm-akla.github.io/.svelte-kit/output/server/chunks/index2.js:123:18)
    at Object.default (file:///home/zippidybop/Projects/srm-akla.github.io/.svelte-kit/output/server/chunks/internal.js:61:98)
    at file:///home/zippidybop/Projects/srm-akla.github.io/.svelte-kit/output/server/entries/pages/_layout.svelte.js:100:78
    at Object.$$render (file:///home/zippidybop/Projects/srm-akla.github.io/.svelte-kit/output/server/chunks/index2.js:123:18)

node:internal/event_target:1096
  process.nextTick(() => { throw err; });
                           ^
Error: 500 /srm-akla.github.io/
To suppress or handle this error, implement `handleHttpError` in https://kit.svelte.dev/docs/configuration#prerender
    at file:///home/zippidybop/Projects/srm-akla.github.io/node_modules/@sveltejs/kit/src/core/config/options.js:212:13
    at file:///home/zippidybop/Projects/srm-akla.github.io/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js:64:25
    at save (file:///home/zippidybop/Projects/srm-akla.github.io/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js:403:4)
    at visit (file:///home/zippidybop/Projects/srm-akla.github.io/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js:236:3)

Node.js v21.6.2

Previously i had this issue, hence i changed the svelte version to 3.2.0 in packages.json. I am not sure if this is the reason why problem arised.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: Sriram_Akella@0.0.1
npm ERR! Found: svelte@4.2.12
npm ERR! node_modules/svelte
npm ERR!   dev svelte@"^4.2.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer svelte@"^3.2.0" from eslint-plugin-svelte3@4.0.0
npm ERR! node_modules/eslint-plugin-svelte3
npm ERR!   dev eslint-plugin-svelte3@"4.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /home/zippidybop/.npm/_logs/2024-02-24T13_48_20_209Z-eresolve-report.txt

My OS info (if that helps)

zippidybop@pop-os
-----------------
OS: Pop!_OS 22.04 LTS x86_64
Host: Aspire A515-47 V1.04
Kernel: 6.6.10-76060610-generic
Uptime: 3 hours, 25 mins
Packages: 2105 (dpkg), 6 (flatpak)
Shell: bash 5.1.16
Resolution: 1920x1080, 1920x1080
DE: GNOME 42.5
WM: Mutter
WM Theme: Pop
Theme: Pop-dark [GTK2/3]
Icons: Pop [GTK2/3]
Terminal: x-terminal-emul
CPU: AMD Ryzen 7 5825U with Radeon Graphics (16) @ 4.546GHz
GPU: AMD ATI 04:00.0 Barcelo
Memory: 4693MiB / 31443MiB

Thanks!

RiadhAdrani commented 8 months ago

Hello, In this line, Assets.Lua is basically undefined because it was not added to the Assets. You can add it or replace it with Assets.Unknown at the moment, and the build/preview should pass.

Let me know if this solution fixed your problem. Best wishes.

Srm-Akla commented 8 months ago

Thanks! That fixed it! I am really interested, how did you figure it out? I have tried reading the error but nothing mentions about Assets.Lua.

RiadhAdrani commented 8 months ago

@Srm-Akla I checked the usage of assets and saw a red swiggly line under the Assets.Lua in the skills page 😅