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.

Webpack 4.0.0 Error

See original GitHub issue

I am trying to use Webpack v4.0.0 and get the following:

ERROR in ./src/Main.elm
Module build failed: TypeError: Cannot read property 'elm' of undefined
    at Object.getOptions (/Users/me/dev/Projects/Elm/webpack4/node_modules/elm-webpack-loader/index.js:37:35)
    at Object.module.exports (/Users/me/dev/Projects/Elm/webpack4/node_modules/elm-webpack-loader/index.js:117:28)
 @ ./src/index.js 1:10-31

webpack.config.js

module.exports = {
	module: {
		rules: [
			{
				test: /\.elm$/,
				exclude: [/elm-stuff/, /node_modules/],
				use: {
					loader: 'elm-webpack-loader'
				}
			}
		],
		noParse: [/\.elm$/]
	}
};

src/index.js

const Elm = require('./Main.elm');
// import Elm from './Main.elm'
console.log('App started...');

src/Main.elm

module Main exposing (main)

import Html exposing (Html, text)


main : Html msg
main =
    text "Hello, Elm!"

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
eeue56commented, Mar 15, 2018

published as 4.5.0

3reactions
ghostcommented, Feb 26, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

webpack 4.0.0-alpha.0 feedback · Issue #6064 - GitHub
And here's an error from running webpack from rails/webpacker: ... Trying to build 3.10 project with webpack 4.0.0-alpha.0 - it fails after ...
Read more >
Unresolved dependency peer webpack@"^4.0.0" from css ...
Based on the error message, there is dependency conflict between css-loader@^2.1.1" and webpack@^4.0.0 . Try npm uninstall --save-dev ...
Read more >
webpack-cli - npm
webpack CLI provides a flexible set of commands for developers to increase speed when setting up a custom webpack project. As of webpack...
Read more >
Installation | webpack
This guide goes through the various methods used to install webpack. Prerequisites. Before we begin, make sure you have a fresh version of...
Read more >
Solved: Module not found: Error: Can't resolve 'sass-loader'
While resolving: twotter@0.1.0 npm ERR! Found: webpack@4.46.0 npm ERR! node_modules/webpack npm ERR! peer webpack@"^4.0.0" from @intervolga/ ...
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 Reddit Thread

No results found

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