Skip to content

[1.0] Typeface produces error in production build #1043

@0x80

Description

@0x80

I'm importing a typeface package in my default layout. It works in development. In production the font also loads, but produces the following error.

bootstrap b3d99bd…:52 Uncaught TypeError: Cannot read property 'call' of undefined
    at t (bootstrap b3d99bd…:52)
    at Object../node_modules/typeface-roboto/index.css (index.css:1)
    at t (bootstrap b3d99bd…:52)
    at Object../node_modules/babel-loader/lib/index.js?{"presets":["/Users/me/project/node_modules/babel-preset-env/lib/index.js","/Users/me/project/node_modules/babel-preset-react/lib/index.js","/Users/me/project/node_modules/babel-preset-stage-1/lib/index.js","/Users/me/project/node_modules/babel-preset-es2015/lib/index.js","/Users/me/project/node_modules/babel-preset-stage-0/lib/index.js","/Users/me/project/node_modules/babel-preset-react/lib/index.js"],"env":{"development":{"plugins":["add-module-exports","flow-react-proptypes",["styled-components",{"minify":false,"displayName":true}]]},"production":{"plugins":["add-module-exports","flow-react-proptypes",["styled-components",{"ssr":true,"displayName":false}]]}},"plugins":["/Users/me/project/node_modules/gatsby/dist/utils/babel-plugin-extract-graphql.js","/Users/me/project/node_modules/babel-plugin-add-module-exports/lib/index.js","/Users/me/project/node_modules/babel-plugin-add-module-exports/lib/index.js","/Users/me/project/node_modules/babel-plugin-transform-object-assign/lib/index.js"],"cacheDirectory":true}!./src/layouts/index.js (index.js:10)
    at t (bootstrap b3d99bd…:52)
    at index.js?9a34:3
    at window.webpackJsonp (bootstrap b3d99bd…:20)
    at layout-component---index-b4f03b0….js:1

It points to this line in bootstrap

// Execute the module function
modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

And further down

exports = module.exports = require("../css-loader/lib/css-base.js")();

in index.css

I didn't change anything to the webpack configuration regarding css. Any idea what might cause this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    stale?Issue that may be closed soon due to the original author not responding any more.type: question or discussionIssue discussing or asking a question about Gatsby

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions