Coder Social home page Coder Social logo

Comments (13)

HugoHeneault avatar HugoHeneault commented on May 20, 2024 5

I didn't manage to get it working even with nuxt@2, so I just use

  import { SpringSpinner } from 'epic-spinners/dist/lib/epic-spinners.min.js'

And I added in my main scss file:

@import '~epic-spinners/dist/lib/epic-spinners.min.css';

from epic-spinners.

xeno avatar xeno commented on May 20, 2024 1

Still broken, this shouldn't be closed.

from epic-spinners.

skapin avatar skapin commented on May 20, 2024 1

Same here, any clue ?

When npm build, i'm getting

ERROR in static/js/0.55e1a31d0eaa216bc664.js from UglifyJs
Unexpected character '`' [./node_modules/epic-spinners/src/services/utils.js:13,0][static/js/0.55e1a31d0eaa216bc664.js:1040,22]

  Build failed with errors.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `node build/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

from epic-spinners.

smartapant avatar smartapant commented on May 20, 2024

@bmarkovic thanks for submitting the bug! We'll try to fix this thing

from epic-spinners.

smartapant avatar smartapant commented on May 20, 2024

@bmarkovic also, what if you try doing import { HalfCircleSpinner } from 'epic-spinners' instead of importing from minified file?

from epic-spinners.

bmarkovic avatar bmarkovic commented on May 20, 2024

The error above was actually exactly from such an import line. You could have seen it if you had bothered to look at the Gist :)

There are details in the Gist why this is happening (namely, the "eval" in node.js gets handled the untraspiled ES6). Tldr of it is: your module should export minified ES5 as it's default entry point as generally majority of SPA webpack setups will not be expecting it not to (and that's mostly where the npm module will be used). The minified ES5 should actually work, tho, for that to be useful.

However, when I import from minified there is no error, but no spinner either.

from epic-spinners.

Eugenizer avatar Eugenizer commented on May 20, 2024

It depends on the version of the Node.js, if you will use stable (10<) - everything will work well.

from epic-spinners.

bmarkovic avatar bmarkovic commented on May 20, 2024

@Eugenizer Not true. I have just tested in an environment running Node 8.11.3 LTS and it behaves absolutely the same. To reproduce you must:

  1. Try it with Nuxt
  2. Trigger server-side rendering by hard-refreshing the page containing the spinner.

from epic-spinners.

Kirill255 avatar Kirill255 commented on May 20, 2024

Unfortunately, I have the same issue.

from epic-spinners.

bmarkovic avatar bmarkovic commented on May 20, 2024

This should be solved with nuxt-edge. I haven't gotten round to testing its. See nuxt.js issue #3485

from epic-spinners.

Kirill255 avatar Kirill255 commented on May 20, 2024

@bmarkovic with nuxt-edge works great, thx

from epic-spinners.

lromor avatar lromor commented on May 20, 2024

I have the same issue.

from epic-spinners.

billsomen avatar billsomen commented on May 20, 2024

2020, the same issue with :
"epic-spinners": "^1.1.0",
"nuxt": "^2.13.3",

from epic-spinners.

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.