Giter Site home page Giter Site logo

Comments (10)

patrykkopycinski avatar patrykkopycinski commented on April 28, 2024

hi @esauter5 try to require css files instead of importing it, i mean:
require('../css/styles.css');

from gatsby.

esauter5 avatar esauter5 commented on April 28, 2024

Forgot to mention I had tried that and the same error results so it doesnt seem to be a problem with the import syntax

from gatsby.

KyleAMathews avatar KyleAMathews commented on April 28, 2024

This is a non-obvious shortcoming with Gatsby right now that your html file gets loaded in Node not Webpack context which means requiring modules that require Webpack fail.

I experimented with https://github.com/petehunt/webpack-require in the past to solve this but ran into this problem. I haven't tried it recently so it could be working now. @esauter5 if you'd like to experiment with adding webpack-require support into serve.js that'd be a nice fix. I've run into this same problem and had to do weird workarounds.

from gatsby.

esauter5 avatar esauter5 commented on April 28, 2024

Thanks for the direction @KyleAMathews. I'll play around and see if I can get a PR to submit

from gatsby.

KyleAMathews avatar KyleAMathews commented on April 28, 2024

👍🏻
On Tue, Nov 10, 2015 at 6:12 PM Eric Sauter [email protected]
wrote:

Thanks for the direction @KyleAMathews https://github.com/KyleAMathews.
I'll play around and see if I can get a PR to submit


Reply to this email directly or view it on GitHub
#83 (comment).

from gatsby.

KyleAMathews avatar KyleAMathews commented on April 28, 2024

@esauter5 pushed fix for this using webpack-require. Will be publishing new release soon. Thanks for your patience!

from gatsby.

esauter5 avatar esauter5 commented on April 28, 2024

Awesome thanks, @KyleAMathews! Sorry I didn't find time to get around to it myself. I worked around it by requiring the css in a different file and then got sidetracked from the project for a bit.

from gatsby.

KyleAMathews avatar KyleAMathews commented on April 28, 2024

@esauter5 no worries, I ended up having to do it as part of a bunch of interrelated changes I was making yesterday. Looking forward to other contributions from you ;-)

from gatsby.

esauter5 avatar esauter5 commented on April 28, 2024

@KyleAMathews Slowly making my way through the code, so I'll eventually start pushing :)

Probably will get in touch with you this week on Reactiflux about some best practices and stuff. Could use some of your Gatsby knowledge.

from gatsby.

KyleAMathews avatar KyleAMathews commented on April 28, 2024

👍 feel free. I'm on Discord most of the time.

from gatsby.

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.