Comments (10)
hi @esauter5 try to require css files instead of importing it, i mean:
require('../css/styles.css');
from gatsby.
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.
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.
Thanks for the direction @KyleAMathews. I'll play around and see if I can get a PR to submit
from gatsby.
👍🏻
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.
@esauter5 pushed fix for this using webpack-require. Will be publishing new release soon. Thanks for your patience!
from gatsby.
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.
@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.
@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.
👍 feel free. I'm on Discord most of the time.
from gatsby.
Related Issues (20)
- Gatsby transform sharp throws intermittent errors HOT 3
- MDX content only rendered after refresh HOT 2
- gatsby-source-mongodb not fetching Atlas data HOT 3
- ModuleParseError: Module parse failed: Unexpected character '@' (2:0) after upgrading gatsby to v5 HOT 1
- `allMarkdownRemark` graphql query in `createPages` intermittently hangs when `excerpt` or `timeToRead` fields are included
- function build error: Error: Module build failed: UnhandledSchemeError HOT 2
- Gatsby 5 is dead? HOT 1
- webpack and other js resources not found when using a subfolder of a static s3 website to serve public files
- Gatsby static site generation not fully prerendering HTML with loadable imports
- Gatsby minimal TS starter generates code with deprecated React import
- gatsby-transformer-remark doesn't accept "engines" plugin option for graymatter
- matchPath seems to be broken since adapters
- The first Headless CMS starter link is broken
- Gatsby + Directus = Build not working HOT 1
- Validation error
- Unexpected missing while creating page
- Invoking imported function inside `createPages` results in error HOT 1
- Gatsby 4 Upgrade - SyntaxError: Invalid left-hand side in assignment
- command curl -X POST http://localhost:8000/__refresh doesn't delete the documents from the CMS
- Serverless function in Gatsby site throwing error and not returning data locally
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 gatsby.