AristideBH / Marqueeck

Marqueeck is a full-featured marquee component for Svelte, flexilble, style-free & highly customizable
https://marqueeck.vercel.app
17 stars 0 forks source link

Parse failure: Export 'MarqueeckOptions' is not defined (4:9) #1

Closed sorae42 closed 11 months ago

sorae42 commented 11 months ago

I can't get this to work. Using svelte 3.59.2 and svelte-kit 1.25.1

Error: Parse failure: Export 'MarqueeckOptions' is not defined (4:9)
At file: /node_modules/.pnpm/@arisbh+marqueeck@0.3.9_svelte@3.59.2/node_modules/@arisbh/marqueeck/dist/index.js
Contents of line 4: export { MarqueeckOptions };
    at ssrTransformScript (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:55343:15)
    at ssrTransform (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:55318:12)
    at Object.ssrTransform (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:64992:20)
    at loadAndTransform (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:54989:24)
    at async instantiateModule (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:55875:10)
Error: Parse failure: Export 'MarqueeckOptions' is not defined (4:9)
At file: /node_modules/.pnpm/@arisbh+marqueeck@0.3.9_svelte@3.59.2/node_modules/@arisbh/marqueeck/dist/index.js
Contents of line 4: export { MarqueeckOptions };
    at ssrTransformScript (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:55343:15)
    at ssrTransform (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:55318:12)
    at Object.ssrTransform (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:64992:20)
    at loadAndTransform (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:54989:24)
    at async instantiateModule (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:55875:10)
Error: Parse failure: Export 'MarqueeckOptions' is not defined (4:9)
At file: /node_modules/.pnpm/@arisbh+marqueeck@0.3.9_svelte@3.59.2/node_modules/@arisbh/marqueeck/dist/index.js
Contents of line 4: export { MarqueeckOptions };
    at ssrTransformScript (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:55343:15)
    at ssrTransform (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:55318:12)
    at Object.ssrTransform (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:64992:20)
    at loadAndTransform (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:54989:24)
    at async instantiateModule (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:55875:10)
Error: Parse failure: Export 'MarqueeckOptions' is not defined (4:9)
At file: /node_modules/.pnpm/@arisbh+marqueeck@0.3.9_svelte@3.59.2/node_modules/@arisbh/marqueeck/dist/index.js
Contents of line 4: export { MarqueeckOptions };
    at ssrTransformScript (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:55343:15)
    at ssrTransform (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:55318:12)
    at Object.ssrTransform (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:64992:20)
    at loadAndTransform (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:54989:24)
    at async instantiateModule (file:///Users/sorae42/Projects/you-ok/node_modules/.pnpm/vite@4.4.9_@types+node@20.8.0/node_modules/vite/dist/node/chunks/dep-df561101.js:55875:10)
AristideBH commented 11 months ago

Thanks for the first feedback ! I'll look into it today

Could you tell me at which step this happens ? Also, are you using Typescript or JS in your projet ?

sorae42 commented 11 months ago

It happens when I import the library to any .svelte file. I use TS for my project.

AristideBH commented 11 months ago

This should be fixed with the last 0.3.92 version. Please update and tell if that works for you.

This brings to my attention that MarqueeckOptions type is not properly exported, thought you should still get autocompletion for Marqueeck props. I'll need to work on that. If you still need to import the MarqueeckOptions type separately, here's a quick workaround until I fix it :

<script lang="ts">
    import Marqueeck from '@arisbh/marqueeck';
    import type { MarqueeckOptions } from '@arisbh/marqueeck/dist/Marqueeck';

    const options: Partial<MarqueeckOptions> = {
        direction: 'left'
    };
</script>

<Marqueeck {options}>hello</Marqueeck>

I'll update the docs with that workaround right now

sorae42 commented 11 months ago

Also you should make the Marqueeck to not have any initial styling so people don't have to customize just to inherit some color from their themes (if they use any UI Toolkits/Framework).

AristideBH commented 11 months ago

You're right, I'll take out the fallback colors from the styles soon 👍 Closing this issue as it seems it's solved this bug

AristideBH commented 11 months ago

Also you should make the Marqueeck to not have any initial styling so people don't have to customize just to inherit some color from their themes (if they use any UI Toolkits/Framework).

Removed the default fallback colors in version 0.3.94 and updated the CSS variables names ;)