slogsdon / parcel-plugin-fable

Parcel asset type plugin for Fable
https://www.npmjs.com/package/parcel-plugin-fable
MIT License
21 stars 4 forks source link

Cannot run example #3

Closed alfonsogarciacaro closed 6 years ago

alfonsogarciacaro commented 6 years ago

Thanks a lot for this, it's great to have the option to use Fable with Parcel :clap: :clap:

I tried to run the example but I got an error. Am I missing something? After cloning this repo I do:

cd example
yarn
dotnet restore
yarn start

But I get:

yarn run v1.2.1
$ yarn dotnet:run-script js:start
Fable (1.3.2) daemon started on port 61225
CWD: /Users/alfonsogarciacaronunez/dev/parcel-plugin-fable/example
yarn run js:start
Server running at http://localhost:1234 
🚨  /Users/alfonsogarciacaronunez/dev/parcel-plugin-fable/example/src/FableDemo.fsproj: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at dirname (path.js:1364:5)
    at localRequire (/Users/alfonsogarciacaronunez/dev/parcel-plugin-fable/example/node_modules/parcel-bundler/src/utils/localRequire.js:8:17)
    at FableAsset.parse (/Users/alfonsogarciacaronunez/dev/parcel-plugin-fable/example/node_modules/parcel-plugin-fable/src/fable-asset.js:9:11)
    at FableAsset.parseIfNeeded (/Users/alfonsogarciacaronunez/dev/parcel-plugin-fable/example/node_modules/parcel-bundler/src/Asset.js:47:29)
    at <anonymous>
slogsdon commented 6 years ago

Thanks for the report, @alfonsogarciacaro! You’re not missing anything, but I do think I missed something yesterday. I have a good idea of the cause, and I should be able to look at this later today.

slogsdon commented 6 years ago

This should be fixed with 6c3d719c06b21d28aa05d6eee55cabd9a6aa3ba0. @alfonsogarciacaro, are you able to pull the latest and retry?

alfonsogarciacaro commented 6 years ago

Great, it's working! Thanks for the quick fix 🐎 I like that the generated code is cleaner than with Webpack. Is there a watch mode? It's not detecting changes in the file atm.

slogsdon commented 6 years ago

Awesome!

Yes, Parcel has a watch mode, but as far as I have noticed, it doesn't always catch file changes for compile-to-JavaScript languages by default. I have #1 to track adding support for this.

slogsdon commented 6 years ago

Closing this now with watch support being added via e628d35631e3040ecfa18b8622c57c0336353.