empress / ember-cli-showdown

Ember component to render markdown into HTML.
https://empress.github.io/ember-cli-showdown/
MIT License
101 stars 35 forks source link

Fix for FastBoot beta #53

Closed simonihmig closed 7 years ago

simonihmig commented 7 years ago

Seems you cannot rely on EMBER_CLI_FASTBOOT being set correctly in treeForVendor. That hook was called just once (with EMBER_CLI_FASTBOOT being undefined), while included got called twice (for browser and FastBoot builds, with EMBER_CLI_FASTBOOT correctly set).

That caused this exception for me:

Error: ENOENT: no such file or directory, open '/Users/simonihmig/Projects/tlw/tmp/source_map_concat-input_base_path-d7N9FNMf.tmp/vendor/fastboot-showdown.js'

Moving that file to vendor regardless of build target (browser/FastBoot) should not matter, as it is still only imported for FastBoot builds...

jasonmit commented 7 years ago

I'm reluctant to merge this as-is since it's pushing fastboot logic into the browser build - which yes it may not be evaluated (unsure) but it's still being bundled.

I would like to be able to verify issue, do you recall which fastboot beta build was causing it?

simonihmig commented 7 years ago

I had the issue with beta.18, downgraded to beta.16 to see if it might be related to the newer beta, but that did not fix it...

I don't think this really affects the browser build. As long as you do not app.import the vendor file, this should not have any effect, does not get merged into the vendor.js, and does not get copied to the dist folder or anything like that. The file is just in some temporary broccoli tree in /tmp, just as any file in /vendor. At least that's my understanding of it.

However I just tested this again with a fresh clean app, and was not able to reproduce. 🤔 Will investigate this a bit, let's put this on hold for now...

simonihmig commented 7 years ago

Somehow I was able to have a successful build now even with my existing app, without the changes here. I have no idea why that is, maybe some weird installation of node_modules before or what else...

Closing this for now, sorry for wasting your time!

jasonmit commented 7 years ago

@simonihmig if you run into it again feel free to reopen to see if we can reproduce. Thanks for following up :)