#! breaking webpack loaders
Nevraeka opened this issue ยท 5 comments
I'm using cross-env
with webpack
and running into this issue when encountering '#!' in rc
...
ERROR in ./~/fsevents/~/rc/index.js
Module parse failed: /MyProfile/my-repo/node_modules/fsevents/node_modules/rc/index.js Un
expected character '#' (1:0)
You may need an appropriate loader to handle this file type.
| #! /usr/bin/env node
| var cc = require('./lib/utils')
| var join = require('path').join
The reference to your repo is a nested dependency inside fsevents
. I can do a PR if needed but I am uncertain how this particular module would work without that. Any thoughts or suggestions?
I am using Node v0.6.8
on Mac OSX and Webpack v2.3.2
Thanks in advance. Also -here is another Github Reference semi-related to this (Meteor)
this is a bug in webpack. see this issue webpack/webpack#2168
that #! has been part of node since forever, if webpack can't handle that, it isn't compatible with node
That is what I would assume. Yeah...that is surprising that Webpack would not be able to handle that. Especially with target: node
as a possible configuration. Sorry for the confusion and thank you for looking into this. I appreciate your time @dominictarr :)
@Nevraeka I think this is a recent webpack thing, because I did not change #! but have suddenly got complaints about webpack. (personally, I use browserify, which handles this fine)
Very strange indeed. On a side note - I like browserify as well. I always enjoyed working w/ StealJS too but alas...I never got the green light to use it at any place I worked. Both are great for small & medium sized projects. Webpack has a lot of great features and scales nicely IMO but the tradeoff is complexity & configuration. My workplace is on the React hype-train ATM so Webpack seems to be the favored tool for now in the React community. I think I bit off more than I can chew though by implementing TypeScript & SSR with Webpack all at once. It sounded good at the time but debugging is sucking ATM :|