Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: TypeError: Cannot read properties of undefined (reading 'filters') #33

Open
AndersonPGS opened this issue Apr 13, 2022 · 1 comment

Comments

@AndersonPGS
Copy link

using the react-palette in a development environment works perfectly, but when launching the project in build (either in vercel or netlify) Errors happen and I can't return the date, returning the following error: (Note: I put a console.log (palette))

{
    data: {}
    error: TypeError: Cannot read properties of undefined (reading 'filters') at new e (https://pocketdex-9o3qcosrx-andersonpgs.vercel.app/assets/index.2529a016.js:251:29349) at Function.e.from (https://pocketdex-9o3qcosrx-andersonpgs.vercel.app/assets/index.2529a016.js:251:41486) at tL (https://pocketdex-9o3qcosrx-andersonpgs.vercel.app/assets/index.2529a016.js:252:20816) at https://pocketdex-9o3qcosrx-andersonpgs.vercel.app/assets/index.2529a016.js:252:21370 at Qg (https://pocketdex-9o3qcosrx-andersonpgs.vercel.app/assets/index.2529a016.js:34:6586) at e.unstable_runWithPriority (https://pocketdex-9o3qcosrx-andersonpgs.vercel.app/assets/index.2529a016.js:19:3794) at hr (https://pocketdex-9o3qcosrx-andersonpgs.vercel.app/assets/index.2529a016.js:30:38587) at Jt (https://pocketdex-9o3qcosrx-andersonpgs.vercel.app/assets/index.2529a016.js:34:6055) at https://pocketdex-9o3qcosrx-andersonpgs.vercel.app/assets/index.2529a016.js:34:5969 at pe (https://pocketdex-9o3qcosrx-andersonpgs.vercel.app/assets/index.2529a016.js:19:2851)
loading: false
}

being that when I'm in a development environment running the "npm run dev" the project works perfectly, returning in the console.log (palette):

data: {vibrant: '#46e5f6', lightVibrant: '#e46889', darkVibrant: '#08313e', muted: '#866c9c', lightMuted: '#bcc4c4', …}
error: undefined
loading: false

what can I do to solve this?

@ryne
Copy link

ryne commented May 1, 2023

Same thing here. Images are showing up on the deployed website (when displaying them as HTML elements), but usePalette(imgURL) results in the error mentioned.

Works as expected in development environment for both cases; images show up and the callback is returned successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants