question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug in new 0.1.* version

See original GitHub issue

Do you want to request a feature or report a bug? bug

What is the current behavior? Can’t build project. Version 0.0.2-alpha.0 works fine.

stacktrace:

ERROR in ./components/App.js
Module build failed: TypeError: /home/a/projects/dl/app/src/components/App.js: Cannot read property 'sourceMap' of undefined
    at /home/a/projects/dl/app/node_modules/linaria/src/babel/lib/errorUtils.js:33:40
    at Array.map (<anonymous>)
    at enhanceFrames (/home/a/projects/dl/app/node_modules/linaria/src/babel/lib/errorUtils.js:32:17)
    at Module._compile (/home/a/projects/dl/app/node_modules/linaria/src/babel/lib/moduleSystem.js:127:11)
    at instantiateModule (/home/a/projects/dl/app/node_modules/linaria/src/babel/lib/moduleSystem.js:55:18)
    at exports.default (/home/a/projects/dl/app/node_modules/linaria/src/babel/preval-extract/prevalStyles.js:60:34)
    at PluginPass.TaggedTemplateExpression (/home/a/projects/dl/app/node_modules/linaria/src/babel/preval-extract/index.js:103:11)
    at newFn (/home/a/projects/dl/app/node_modules/babel-traverse/lib/visitors.js:276:21)
    at NodePath._call (/home/a/projects/dl/app/node_modules/babel-traverse/lib/path/context.js:76:18)
    at NodePath.call (/home/a/projects/dl/app/node_modules/babel-traverse/lib/path/context.js:48:17)
    at NodePath.visit (/home/a/projects/dl/app/node_modules/babel-traverse/lib/path/context.js:105:12)
    at TraversalContext.visitQueue (/home/a/projects/dl/app/node_modules/babel-traverse/lib/context.js:150:16)
    at TraversalContext.visitSingle (/home/a/projects/dl/app/node_modules/babel-traverse/lib/context.js:108:19)
    at TraversalContext.visit (/home/a/projects/dl/app/node_modules/babel-traverse/lib/context.js:192:19)
    at Function.traverse.node (/home/a/projects/dl/app/node_modules/babel-traverse/lib/index.js:114:17)
    at NodePath.visit (/home/a/projects/dl/app/node_modules/babel-traverse/lib/path/context.js:115:19)
    at TraversalContext.visitQueue (/home/a/projects/dl/app/node_modules/babel-traverse/lib/context.js:150:16)
    at TraversalContext.visitMultiple (/home/a/projects/dl/app/node_modules/babel-traverse/lib/context.js:103:17)
    at TraversalContext.visit (/home/a/projects/dl/app/node_modules/babel-traverse/lib/context.js:190:19)
    at Function.traverse.node (/home/a/projects/dl/app/node_modules/babel-traverse/lib/index.js:114:17)
    at NodePath.visit (/home/a/projects/dl/app/node_modules/babel-traverse/lib/path/context.js:115:19)
    at TraversalContext.visitQueue (/home/a/projects/dl/app/node_modules/babel-traverse/lib/context.js:150:16)
    at TraversalContext.visitMultiple (/home/a/projects/dl/app/node_modules/babel-traverse/lib/context.js:103:17)
    at TraversalContext.visit (/home/a/projects/dl/app/node_modules/babel-traverse/lib/context.js:190:19)
    at Function.traverse.node (/home/a/projects/dl/app/node_modules/babel-traverse/lib/index.js:114:17)
    at NodePath.visit (/home/a/projects/dl/app/node_modules/babel-traverse/lib/path/context.js:115:19)
    at TraversalContext.visitQueue (/home/a/projects/dl/app/node_modules/babel-traverse/lib/context.js:150:16)
    at TraversalContext.visitSingle (/home/a/projects/dl/app/node_modules/babel-traverse/lib/context.js:108:19)
    at TraversalContext.visit (/home/a/projects/dl/app/node_modules/babel-traverse/lib/context.js:192:19)
    at Function.traverse.node (/home/a/projects/dl/app/node_modules/babel-traverse/lib/index.js:114:17)
 @ ./index.js 11:11-38

Please provide your exact Babel configuration and mention your Linaria, Node, Yarn/npm version and operating system.

linaria 0.1.3 Node 8.6.0 Yarn 1.0.1

.babelrc

{
  "presets": [
    "react-app",
    "flow",
    ["env", {"targets": {"browsers": ["last 2 versions"]}}],
    "linaria/babel"
  ],
  "plugins": [
    ["transform-class-properties", { "spec": true }]
  ]
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
pronevichcommented, Oct 10, 2017

Yep, all works now )

1reaction
pronevichcommented, Oct 9, 2017

I looked at linaria website webpack config, pretty similar to my:

import path from 'path'
import webpack from 'webpack'
import CleanWebpackPlugin from 'clean-webpack-plugin'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import ExtractTextPlugin from 'extract-text-webpack-plugin'
import PreloadWebpackPlugin from 'preload-webpack-plugin'
import CopyWebpackPlugin from 'copy-webpack-plugin'
import OfflinePlugin from 'offline-plugin'
import dotenv from 'dotenv'

dotenv.config()

const FIREBASE_CONFIG = JSON.stringify({
  apiKey: process.env.FIREBASE_API_KEY,
  authDomain: process.env.FIREBASE_AUTH_DOMAIN,
  storageBucket: process.env.FIREBASE_STORAGE_BUCKET,
})

const ENTRY = './index.js'
const PORT = process.env.PORT || 8080
const PRODUCTION = process.env.NODE_ENV === 'production'
const DEV = !process.env.NODE_ENV || process.env.NODE_ENV === 'development'

export default {
  context: path.join(__dirname, 'src'),
  entry: PRODUCTION
    ? ENTRY
    : [`webpack-dev-server/client?http://localhost:${PORT}`, ENTRY],
  output: {
    path: path.join(__dirname, 'build'),
    filename: PRODUCTION ? '[name].[chunkhash].js' : '[name].js',
    chunkFilename: PRODUCTION ? '[name].[chunkhash].js' : '[name].js',
    publicPath: '/',
  },

  resolve: {
    extensions: ['.js', '.json'],
    modules: ['node_modules', path.resolve(__dirname, 'node_modules')],
  },

  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'babel-loader',
      },
      {
        test: /\.(woff2?|ttf|eot)(\?.*)?$/,
        use: 'file-loader',
      },
      {
        test: /\.jpe?g$/,
        loader: 'responsive-loader',
        options: {
          placeholder: true,
          placeholderSize: 40,
          name: './assets/[hash].[ext]',
        },
      },
      {
        test: /\.(gif|png|svg)$/,
        use: [
          // {
          // 	loader: 'file-loader',
          // 	options: {
          // 		name: '[path][name].[hash].[ext]'
          // 	}
          // },
          // {
          // 	loader: 'image-webpack-loader',
          // 	query: {
          // 		mozjpeg: {
          // 			quality: 65,
          // 			progressive: false
          // 		},
          // 		pngquant: {
          // 			quality: '65-90',
          // 			speed: 4
          // 		}
          // 	}
          // },
        ],
      },
    ].concat(
      PRODUCTION
        ? {
            test: /\.css$/,
            use: ExtractTextPlugin.extract({
              fallback: 'style-loader',
              use: 'css-loader',
            }),
          }
        : {
            test: /\.css$/,
            use: [{ loader: 'style-loader' }, { loader: 'css-loader' }],
          },
    ),
  },
  plugins: [
    new CleanWebpackPlugin(['build']),
    new webpack.DefinePlugin({
      FIREBASE_CONFIG,
      'process.env': {
        NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development'),
      },
    }),
    new HtmlWebpackPlugin({
      template: 'index.ejs',
      filename: 'index.html',
      hash: false,
      minify: {
        collapseWhitespace: true,
        keepClosingSlash: true,
        removeComments: true,
        removeEmptyAttributes: true,
      },
    }),
    new webpack.optimize.CommonsChunkPlugin({
      name: 'app',
    }),
    new PreloadWebpackPlugin({
      rel: 'preload',
      include: 'asyncChunks',
    }),
    new CopyWebpackPlugin([
      { from: './manifest.json' },
      { from: './favicon.ico' },
    ]),
  ].concat(
    PRODUCTION
      ? [
          new ExtractTextPlugin({
            filename: 'css/[name].css?[hash]',
            disable: false,
            allChunks: true,
          }),
          new OfflinePlugin({
            relativePaths: false,
            AppCache: false,
            excludes: ['_redirects'],
            ServiceWorker: {
              events: true,
            },
            cacheMaps: [
              {
                match: /.*/,
                to: '/',
                requestTypes: ['navigate'],
              },
            ],
            publicPath: '/',
          }),
          new webpack.optimize.UglifyJsPlugin(),
        ]
      : [
          new webpack.HotModuleReplacementPlugin(),
          new webpack.NamedModulesPlugin(),
          new webpack.NoEmitOnErrorsPlugin(),
        ],
  ),
  devtool: 'source-map',
  devServer: {
    port: PORT,
    host: 'localhost',
    publicPath: '/',
    contentBase: './src',
    historyApiFallback: true,
    open: false,
    openPage: '',
    hotOnly: true,
    proxy: {
      // OPTIONAL: proxy configuration:
      // '/optional-prefix/**': { // path pattern to rewrite
      //   target: 'http://target-host.com',
      //   pathRewrite: path => path.replace(/^\/[^\/]+\//, '')   // strip first path segment
      // }
    },
  },
  stats: { colors: true },
}

Read more comments on GitHub >

github_iconTop Results From Across the Web

9 December, 2022 - 2.7.0.1 Update | Bug Reports Megathread
Ahoy! This thread is in place to centralise bug reporting for the 2.7.0 update, and improve visibility for Rare. Don't forget to also...
Read more >
MultiVersus Open Beta v.0.1 patch notes released - EventHubs
There are quite a few bug fixes that are being implemented, but there are also a few notable changes. More specifically, Batman, Bugs...
Read more >
BIG-IP 17.0.0.1 Fixes and Known Issues - AskF5 - F5 Networks
Enhanced application to accept new sessions under problem conditions. Fixed Versions: 17.0.0.1. 886649-6 : Connections stall when dynamic BWC ...
Read more >
how to workaround npm "Error: Invalid version: "0.1" BUG?
I tried to fix the error manually by replacing "version": "0.1", with "version": "0.0.1", in package.json files in modules directories but there ...
Read more >
Semantic Versioning 0.1.0
A bug fix is defined as an internal change that fixes incorrect behavior. Minor version Y (x.Y.z, x > 0) MUST be incremented...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found