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

Template generation failed #7

Closed
aantron opened this issue Jul 1, 2021 · 10 comments
Closed

Template generation failed #7

aantron opened this issue Jul 1, 2021 · 10 comments

Comments

@aantron
Copy link
Contributor

aantron commented Jul 1, 2021

I'm currently hitting the error below. I first reached this a few days ago, and I waited for the dream-livereload release in case that was the cause. However, this is still occurring after opam update and confirming that opam knows about dream-livereload with opam list.

opam install --deps-only --with-test --with-doc -y .
[WARNING] Failed checks on a package definition from source at file:///mnt/c/Users/Антон/code/attic/spin-dream:
  warning 47: Synopsis (or description first line) should start with a capital and not end with a dot
The following additional pinnings are required by a.~dev:
  - dream-livereload.0.1.0 at https://github.com/tmattio/dream-livereload.git
  - dream-cli.0.1.0 at https://github.com/tmattio/dream-cli.git
Continue? [Y/n] y
[dream-livereload.0.1.0] downloaded from https://github.com/tmattio/dream-livereload.git
[ERROR] Error getting source from https://github.com/tmattio/dream-livereload.git:
          - Unknown archive type: /tmp/opam-13862-1872ec/dream-livereload.git

make: *** [Makefile:14: deps] Error 40
opam-spin: [ERROR] The template generation failed:
The command make deps did not run successfully: exited with code 2
@tmattio
Copy link
Collaborator

tmattio commented Jul 1, 2021

Thanks @aantron! I am not sure that's the root cause, but I just removed the pins in master. Would you mind trying the generation again?

@aantron
Copy link
Contributor Author

aantron commented Jul 1, 2021

I now get to a second install (with alcotest, etc.), but afterwards:

opam-spin: [DEBUG] Running make build
opam exec -- dune build --root .
        node asset/main.css (exit 1)
(cd _build/default && /usr/bin/node node_modules/tailwindcss/lib/cli.js build -c tailwind.config.js -o asset/main.css)
/mnt/c/Users/Антон/code/attic/spin-dream/_build/default/node_modules/tailwindcss/lib/jit/corePlugins.js:242
  ...Object.fromEntries(Object.entries(corePlugins).map(([pluginName, plugin]) => {
            ^

TypeError: Object.fromEntries is not a function
    at Object.<anonymous> (/mnt/c/Users/Антон/code/attic/spin-dream/_build/default/node_modules/tailwindcss/lib/jit/corePlugins.js:242:13)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/mnt/c/Users/Антон/code/attic/spin-dream/_build/default/node_modules/tailwindcss/lib/jit/lib/setupContextUtils.js:36:43)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
make: *** [Makefile:30: build] Error 1
opam-spin: [ERROR] The template generation failed:
The command make build did not run successfully: exited with code 2

@tmattio
Copy link
Collaborator

tmattio commented Jul 2, 2021

Could it be that you're running an "old" version of NodeJS? Tailwind requires Node 12.13 or higher (https://tailwindcss.com/docs/upgrading-to-v2#upgrade-to-node-js-12-13-or-higher)

If this is the issue, I'll add a requirement section in the README, alongside the other suggestions laid down in #5

@tmattio
Copy link
Collaborator

tmattio commented Jul 2, 2021

Also, the default choices shouldn't fail with this error, as they don't include TailwindCSS. Can you confirm that you explicitly chose to generate the TailwindCSS setup?

@aantron
Copy link
Contributor Author

aantron commented Jul 2, 2021

Also, the default choices shouldn't fail with this error, as they don't include TailwindCSS. Can you confirm that you explicitly chose to generate the TailwindCSS setup?

Yes, I chose all options to exercise everything.

@aantron
Copy link
Contributor Author

aantron commented Jul 2, 2021

Could it be that you're running an "old" version of NodeJS? Tailwind requires Node 12.13 or higher (https://tailwindcss.com/docs/upgrading-to-v2#upgrade-to-node-js-12-13-or-higher)

If this is the issue, I'll add a requirement section in the README, alongside the other suggestions laid down in #5

I have Node 10.19.0 installed. Could you add the requirement, together with a link to instructions somewhere that show how to upgrade Node? I am using Node from Ubuntu 20.04, so this is a pretty aggressive constraint.

@tmattio
Copy link
Collaborator

tmattio commented Jul 2, 2021

I've added some instructions in the README, alongside with a recommendation to use nvm to manage other versions of Node.

Here are the commands to install it:

# Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
# Reload bash
source ~/.bashrc
# Install an NPM version, 14 is the latest LTS
nvm install 14
# Use the version in your current prompt
nvm use 14

@aantron
Copy link
Contributor Author

aantron commented Jul 2, 2021

These instructions don't work for fish, see nvm-sh/nvm#303. Looking for good workarounds.

@tmattio
Copy link
Collaborator

tmattio commented Jul 2, 2021

Arg.. I this case maybe the best method for you would be to upgrade your system node's version?

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

@aantron
Copy link
Contributor Author

aantron commented Jul 4, 2021

Template generation has now succeeded, thanks!

@aantron aantron closed this as completed Jul 4, 2021
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