Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling html file #14

Open
bsbechtel opened this issue Apr 1, 2017 · 3 comments
Open

Error compiling html file #14

bsbechtel opened this issue Apr 1, 2017 · 3 comments

Comments

@bsbechtel
Copy link

I'm trying to use meteor-client-bundler to package an existing meteor app for use on a new React Native project. The RN project is in a directory at the same level as the meteor app. When I try running meteor-client bundle --source=../myMeteorApp, I get the following error:

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

My client html file has both tags in it, and is being used with React in the Meteor app. Any idea what might be causing this? Thanks!

@bsbechtel
Copy link
Author

It turns out this was an issue with how the config["imports"] packages were being loaded. I have a PR ready to submit, but do I need specific permissions to contribute to the project?

@eliezedeck
Copy link

@bsbechtel Can you share a quick fix? This won't seem to be fixed anytime soon. Repo seems inactive.

@bsbechtel
Copy link
Author

Sure...this is line 52-64 of the bundler.js file in /lib:

  // If a packages file was provided, use it in the dummy project
  if (sourceDir) {
    var sourcePacksFile = Path.resolve(sourceDir, ".meteor/packages");
    var sourcePacksContent = Fs.readFileSync(sourcePacksFile).toString();
    // Write the composed content to the temp packages file
    Fs.writeFileSync(tempPacksFile, sourcePacksContent);
  }
  // Compose packages file based on provided config
  if (config["import"]) {
    var tempPacksContent = config["import"].join("\n");
    Fs.writeFileSync(tempPacksFile, tempPacksContent);
  }


All you really need is the if (config["import"]) { line. Hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants