meteor-client-bundler icon indicating copy to clipboard operation
meteor-client-bundler copied to clipboard

meteor-client-bundler doesn't like 'static-html'

Open atao60 opened this issue 5 years ago • 4 comments

See demo on github: https://github.com/atao60/angular-meteor-example-AngularCLI-bare. It's in a non working status to show the issue.

The installation is described in detail in the file HISTORY.

Trying to set up a minimal configuration to be used with meteor-client-bundler, I started from scratch and used meteor create --base in place of meteor create. Then meteor-client-bundler crashed:

Errors prevented bundling:                    
While processing files with static-html (for target web.browser):
client/main.html:12: Expected <head> or <body> tag

While processing files with static-html (for target web.browser.legacy):
client/main.html:12: Expected <head> or <body> tag

/home/pierre/Développements/pwa/cornflourblue-ng6-bs4-login/demo7B/node_modules/meteor-client-bundler/node_modules/execa/index.js:350
		throw err;
		^

As soon as static-html is removed from api/.meteor/packages, everything runs fine.

meteor-client-bundler should be able to deal with api/.meteor/packages's content, whatever the template used to create it.

atao60 avatar Aug 18 '18 22:08 atao60

I will look at this issue soon, but PRs are welcome :)

ardatan avatar Aug 18 '18 22:08 ardatan

PRs are welcome

I have no clues on what direction to get. MCB has a very indifferent policy about what can be taken in account as meteor packages. In this spirit, if 'static-html' is there, MCB must keep it? Then please it by providing a default dummy file client/main.htm, something like an empty body <body></body>.

PS. In my own projects I don't need 'static-html', so removing it before running MCB is OK for me.

atao60 avatar Aug 19 '18 10:08 atao60

I simply removed static-html from meteor by command:

cd api
meteor remove static-html

because of meteor can communicate with frontend by DDP or REST or APOLLO so there is no sense of using static-html. Potentially if you want to render html you can use express in meteor.

gustawdaniel avatar Nov 16 '18 21:11 gustawdaniel

@ardatan do you think we should add message about there is no point use static-html with meteor-client-bundler if this package would be detected?

I suggest add to docs info that anyone should remove this package, because of it is added by default to meteor create --bare.

In article

https://blog.meteor.com/leverage-the-power-of-meteor-with-any-client-side-framework-bfb909141008

this is not mentioned because of on list of packages installed by default by meteor

https://docs.meteor.com/commandline.html

static-html is not listed for standard meteor create, but in context of this package meteor create --bare seems to be more appropriate because of in typical usage of this package blaze-html-templates and most packages from default version are not needed too.

gustawdaniel avatar Nov 16 '18 21:11 gustawdaniel