Comments (11)
The dom-events module requires the use of a JSON loader for Webpack otherwise it won't work.
A solution for this :
npm install --save json-loader
Then in your webpack config file:
module: { loaders: [ { test: /\.json$/, loader: 'json' } ] }
Works like a charm for me now with Webpack. 🍺
from smooth-scrolling.
Not sure, because you're not using it as a module but a single file. That means the module has an issue, so I'm leaving this open until I find a solution.
from smooth-scrolling.
Hi,
Thanks for pointing this out!
I'm not using webpack, but did you tried looking at this issue or this blog post ?
Seems like we have to add a webpack.config.js
— but I'm not completely sure.
Otherwise, can you try to edit the package.json
file of the module and replace "main": "index.js"
with "main": "smooth-scrolling.js"
; relaunch the build task (using npm scripts, gulp, grunt or whatever you use) and see if you still have the error.
from smooth-scrolling.
hi,
Yeah I am using babel-presets/.babelrc (which they are recommending in the posts).
I tried doing what you said in the package.json and now I'm getting the following:
http://puu.sh/o5FRH/b1e2090bfa.png
Would be cool to get it working with webpack, if not I will need to jump back to my browserify/gulp setup=)
from smooth-scrolling.
Okay, then I guess we should keep index.js
as the main entry point.
Did you tried the "configuring babel-loader" section of the blog post ?
I think you specially need a loaders
key in the webpack.config.js
along the .babelrc
file:
loaders: [
{
loader: "babel-loader",
include: [
path.resolve(__dirname, "src"),
],
test: /\.js?$/,
query: {
presets: ['es2015'],
}
}
]
This is basically what the error is about but maybe you'll need a couple of adjustments to make it work.
Also, do you have a "browserify" key in your project's package.json ? This is what I have on my projects. Maybe it can help!
from smooth-scrolling.
Hmm yes, I think I have my webpack.config.js configured similiar. Here is a pic of how my config looks:
http://puu.sh/o5RO7/2c3a06ed28.png
When I google this issue i mostly see the .babelrc and es2015 preset solution which I already have implemented, since I had a similiar issue earlier. Maybe I have to google harder=)
from smooth-scrolling.
I also had a hard time figuring out how to make babel work with my browserify setup when they updated to 6.0.. 😄
Maybe try to copy index.js
(since you have a babel transform on your src
folder) and just import directly the file, see if you still have the initial error? In that case I guess my transform presets loader query export thingy is not correctly set up! 😅
from smooth-scrolling.
I hate when configuring stuff takes longer than the actual work:P
I tried copying the index.js and installed the dependencies (dom-classes, dom-event etc) but getting errors, wasn't these hit by that whole NPM drama last week?
from smooth-scrolling.
Yeah indeed; I use the git repo for now, see package.json
. Add theses lines and just re-run npm i
from smooth-scrolling.
Thanks, got it working now, guess that means the problem lays within my configuration then?:)
from smooth-scrolling.
Wow thanks a lot @jackismissing ! 😄 Can you maybe post a PR or the full webpack.config.js
file so I can close this issue ?
🍻
from smooth-scrolling.
Related Issues (20)
- Horizontal scroll demos not working HOT 2
- (Parallax demo) vs-scrollbar-smooth and vs-scrollbar-parallax got different scroll position after smooth.scrollTo
- Build version including parallax HOT 4
- Empty space at page bottom when transitioning page HOT 2
- Has the latest version been published to NPM? HOT 2
- scrollTo() after resize HOT 2
- Cannot find module 'babelify'
- Next.js Compatibility HOT 2
- Immediately set the scroll position HOT 2
- How to implement with GSAP ScrollTrigger HOT 17
- Scroll event on container not working
- Hiding the scroll thumb when content doesn't extend beyond viewport. HOT 4
- Scrolling section responsive
- Uncaught TypeError: Class constructor Smooth cannot be invoked without 'new' HOT 1
- Error when building HOT 1
- StickySidebar with Smooth-Scroll
- Use native touch scrolling? HOT 6
- Smooth.resize() when using native gives error. HOT 1
- Custom easing function? HOT 1
- Horizontal scroll demo with both Y and X scrolling HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smooth-scrolling.