Giter VIP home page Giter VIP logo

Comments (4)

Marcosaurios avatar Marcosaurios commented on May 20, 2024 2

Okey, after a few weeks with this headache seems I have found a workaround to fix this temporarily...
Adding the CommonJS dependencies to the vite config avoids being bundled by vite:

In the svelte.config.js:

const config = {
 kit: {
  vite: {
   ssr: {
    noExternal: ['style-value-types', 'popmotion', 'framesync']
   }
  }
 }
}

See sveltejs/kit#928 (comment)

from svelte-motion.

Marcosaurios avatar Marcosaurios commented on May 20, 2024

Hey Rick!
I have the same issue you have here, but I think the stopper here is the 'style-value-types' dependency, which fails being loaded by Vite I guess...

11:39:06 PM: > Named export 'alpha' not found. The requested module 'style-value-types' is a CommonJS module, which may not support all module.exports as named exports.
11:39:06 PM: CommonJS modules can always be imported via the default export, for example using:
11:39:06 PM: import pkg from 'style-value-types';
11:39:06 PM: const { number, px, degrees, scale, alpha, progressPercentage, complex, color, filter, percent, vw, vh } = pkg;
11:39:06 PM:
11:39:06 PM: file:///opt/build/repo/.svelte-kit/output/server/app.js:25
11:39:06 PM: import { number, px, degrees, scale, alpha, progressPercentage, complex, color, filter, percent, vw, vh } from "style-value-types";

As the error states, the problem is in the style-value-typesmodule, which should be ESM and not CommonJS module... but in their repo I don't see any intention to switch it to ESM...

from svelte-motion.

RickRyan26 avatar RickRyan26 commented on May 20, 2024

Just saw all this. This work around looks great to me! Thank you

from svelte-motion.

JustMrMendez avatar JustMrMendez commented on May 20, 2024

Okey, after a few weeks with this headache seems I have found a workaround to fix this temporarily... Adding the CommonJS dependencies to the vite config avoids being bundled by vite:

In the svelte.config.js:

const config = {
 kit: {
  vite: {
   ssr: {
    noExternal: ['style-value-types', 'popmotion', 'framesync']
   }
  }
 }
}

See sveltejs/kit#928 (comment)

Thanks for that, it worked 👍🏻

from svelte-motion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.