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

Velocity and React Compatibility #743

Closed
PascalPixel opened this issue Jan 26, 2017 · 5 comments
Closed

Velocity and React Compatibility #743

PascalPixel opened this issue Jan 26, 2017 · 5 comments
Assignees

Comments

@PascalPixel
Copy link

// Something.js

import React from 'react'
import Velocity from 'velocity-animate'
import 'velocity-animate/velocity.ui'
// Log

Module not found: Error: Can't resolve 'velocity' in '/Users/Username/Repo/node_modules/velocity-animate'
 @ ./~/velocity-animate/velocity.ui.js 19:2-31
 @ ./src/components/Work/Paubox/Interactive.js
 @ ./src/components/Work/Paubox/index.js
 @ ./src/components/index.js
 @ ./src/index.js
 @ multi main

Referencing #479 (comment)

@Rycochet Rycochet self-assigned this Feb 7, 2017
@Rycochet
Copy link
Collaborator

Rycochet commented Feb 7, 2017

I will look into this when I get time, I'm just very busy right now - I've not forgotten, and have cloned the demonstration repo for when I can do something.

@PascalPixel PascalPixel changed the title Velocity + UI in Webpack ES6 import can't resolve Velocity and React Compatibility Feb 9, 2017
abercrave added a commit to abercrave/velocity that referenced this issue Apr 1, 2017
@abercrave
Copy link

My setup:

Node v7.7.3
Webpack 2.3.2
Velocity 1.5.0

// index.js

import 'velocity-animate';
import 'velocity-animate/velocity.ui';

Error:

ERROR in ./~/velocity-animate/velocity.ui.js
Module not found: Error: Can't resolve 'velocity' in '/Users/bevans/projects/musa/frontend/node_modules/velocity-animate'
 @ ./~/velocity-animate/velocity.ui.js 19:2-31
 @ ./app/index.js
 @ multi babel-polyfill ./app/index.js ./app/styles/main.scss

@abercrave
Copy link

The errors in React and Webpack are identical, but I can create a new issue specific to Webpack 2 if you like.

@FHoulbreque
Copy link

As you're, I weren't able to use import statement...

I have to register it outside react (or vue) like this:

window.Velocity = require('velocity-animate');
require('velocity-animate/velocity.ui');

@Rycochet
Copy link
Collaborator

The Velocity namespace for import is now "velocity-animate" and should fix this issue (as of 2.0.2).

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

4 participants