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

Cannot find module "wrappers/md" #43

Closed
fson opened this issue Sep 23, 2015 · 4 comments
Closed

Cannot find module "wrappers/md" #43

fson opened this issue Sep 23, 2015 · 4 comments

Comments

@fson
Copy link
Contributor

fson commented Sep 23, 2015

Steps to reproduce:

npm install -g [email protected]
gatsby new gatsby-test
cd gatsby-test
gatsby build
Generating static html pages
failed at generating static html pages
{ [Error: Cannot find module "wrappers/md"] code: 'MODULE_NOT_FOUND' }
@fson
Copy link
Contributor Author

fson commented Sep 23, 2015

Shouldn't this be a relative path ./wrappers/md? I wonder how it worked before. Does CoffeeScript handle imports differently?

@KyleAMathews
Copy link
Contributor

The problem is we switched the wrappers to use .jsx and our babel-loader config is currently excluding modules passing the regex /node_modules/. Which is fine when I'm developing locally but when installed, the path of the wrappers is /usr/local/lib/node_modules/gatsby/lib/isomorphic/wrappers/ which means they're not getting compiled with JSX which means they're throwing an error (the errors are easier to see if you do gatsby serve and look in your browser console).

Trying now to fix the regex to not exclude Gatsby lib files.

@KyleAMathews
Copy link
Contributor

So it turns out you can use a function for the exclude check on loaders which proved a lot simpler than trying to write a gnarly regex that would only exclude the "right" node_module directories.

Released a 0.4.3 with the fix.

Thanks for the bug report!

@KyleAMathews
Copy link
Contributor

Also the reason things worked with cjsx/coffeescript before was their loaders don't exclude node_modules files like babel does.

ChristopherBiscardi added a commit to ChristopherBiscardi/gatsby that referenced this issue Jun 9, 2019
experimental mdx-deck support
=======================

* [kitchen-sink] Switch away from gatsby-plugin-emotion (replace it with raw gatsby-ssr/browser) so we can avoid the babel plugin and use styled-components (a dependency of mdx-deck) on the same site
* Introduce the .deck-mdx extension (highly experimental but works for now? I wanted .deck.mdx but couldn't get it to work)
* [kitchen-sink] pages are now namespaced by filesystem source name (posts, slides, etc) to make it easier to identify when debugging

TODO:

- what cool stuff can we do for default components, default themes, custom themes, etc
- can we integrate the "save pdf" workflow from mdx-deck?
- more examples to fully test the integration
ChristopherBiscardi added a commit to ChristopherBiscardi/gatsby that referenced this issue Jun 27, 2019
experimental mdx-deck support
=======================

* [kitchen-sink] Switch away from gatsby-plugin-emotion (replace it with raw gatsby-ssr/browser) so we can avoid the babel plugin and use styled-components (a dependency of mdx-deck) on the same site
* Introduce the .deck-mdx extension (highly experimental but works for now? I wanted .deck.mdx but couldn't get it to work)
* [kitchen-sink] pages are now namespaced by filesystem source name (posts, slides, etc) to make it easier to identify when debugging

TODO:

- what cool stuff can we do for default components, default themes, custom themes, etc
- can we integrate the "save pdf" workflow from mdx-deck?
- more examples to fully test the integration
johno pushed a commit to johno/gatsby that referenced this issue Jul 17, 2019
experimental mdx-deck support
=======================

* [kitchen-sink] Switch away from gatsby-plugin-emotion (replace it with raw gatsby-ssr/browser) so we can avoid the babel plugin and use styled-components (a dependency of mdx-deck) on the same site
* Introduce the .deck-mdx extension (highly experimental but works for now? I wanted .deck.mdx but couldn't get it to work)
* [kitchen-sink] pages are now namespaced by filesystem source name (posts, slides, etc) to make it easier to identify when debugging

TODO:

- what cool stuff can we do for default components, default themes, custom themes, etc
- can we integrate the "save pdf" workflow from mdx-deck?
- more examples to fully test the integration
KyleAMathews pushed a commit that referenced this issue Mar 27, 2020
* Update README.md

* Update 000-cli-redesign.md

* Update 000-structured-logging.md

* Update 0001-github-issue-labels.md

* Update 0006-node-8-minimum-version.md
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

2 participants