Comments (10)
I also get a segfault just running nix run github:a-h/templ
. When I run nix develop github:a-h/templ
, I get a dev shell but theres no templ
in it's PATH. It seems like the templ flake itself has some issues.
from templ.
It works OK for me. Can't really help without knowing what the logs say.
0 0 /Users/adrian % nix run github:a-h/templ
usage: templ <command> [<args>...]
templ - build HTML UIs with Go
See docs at https://templ.guide
commands:
generate Generates Go code from templ files
fmt Formats templ files
lsp Starts a language server for templ files
migrate Migrates v1 templ files to v2 format
version Prints the version
nix develop
won't have templ in the path, it's a development shell containing all the things you need to develop templ, not to use it. Re-reading the docs at templ.guide, I can see that's the docs are a bit wrong there. The dev shell used to contain a Neovim config, but not any more, because it was downloading way too much stuff.
from templ.
This is what I get:
$ nix run github:a-h/templ
munmap_chunk(): invalid pointer
fish: Job 1, 'nix run github:a-h/templ' terminated by signal SIGABRT (Abort)
Earlier I got:
$ nix run github:a-h/templ
copying '/nix/store/7mhipfj7kvxyfj9zwkyf78ha1yfl07hp-source' to the store
fish: Job 1, 'nix run github:a-h/templ' terminated by signal SIGSEGV (Address boundary error)
In Bash it looks like this:
$ nix run github:a-h/templ
free(): invalid size
Aborted (core dumped)
Same SIGSEGV error when I use it in my flake.
from templ.
Architecture, version of Nix, operating system...?
from templ.
Ah yeah, sorry.
x86_64, nix 2.21.0, Arch Linux.
I tried in a fresh archlinux container (so no modifications by me), installed nix from the official packages and ran it. Got the same segmentation fault.
podman run -it --rm docker.io/archlinux:latest bash -c "pacman -Syq --noconfirm nix && nix --version && nix --extra-experimental-features 'nix-command flakes' run github:a-h/templ"
But this (increased verbosity) worked at least once but is now also failing:
podman run -it --rm docker.io/archlinux:latest bash -c "pacman -Syq --noconfirm nix && nix --version && nix -vv --extra-experimental-features 'nix-command flakes' run github:a-h/templ"
Is there a race condition in the build process of templ?
The errors I'm getting are completely random. I'm not sure if templ is the problem or nix itself. Weirdly I'm only getting this when I try to use templ.
from templ.
Just tried it on native NixOS and that worked. I'm too tired, I'll reboot my Arch system and continue testing tomorrow.
from templ.
@XenGi are you happy for this to be closed? It seems you said it worked?
from templ.
Just as an extra data point, it's working OK for me on x86-64 Ubuntu with Nix installed. My previous example was running the flake on aarch-64 Darwin (M1 Mac).
0 0 /home/adrian-hesketh % nix run github:a-h/templ
warning: Ignoring setting 'auto-allocate-uids' because experimental feature 'auto-allocate-uids' is not enabled
warning: Ignoring setting 'impure-env' because experimental feature 'configurable-impure-env' is not enabled
usage: templ <command> [<args>...]
templ - build HTML UIs with Go
See docs at https://templ.guide
commands:
generate Generates Go code from templ files
fmt Formats templ files
lsp Starts a language server for templ files
migrate Migrates v1 templ files to v2 format
version Prints the version
(Nix 2.20.1)
from templ.
Same here!
[0][~]$ nix run github:a-h/templ
[1/0/1 copied (148.4/148.4 MiB), 25.5 MiB DL] fetching source from https://cache.nixos.org
usage: templ <command> [<args>...]
templ - build HTML UIs with Go
See docs at https://templ.guide
commands:
generate Generates Go code from templ files
fmt Formats templ files
lsp Starts a language server for templ files
migrate Migrates v1 templ files to v2 format
version Prints the version
[0][~]$ nix --version
nix (Nix) 2.18.1
[0][~]$ uname
Darwin
[0][~]$ uname -p
i386
[0][~]$ uname -m
x86_64
from templ.
Closed, since no further information was provided, and we've been unable to reproduce the issue on Linux machines, and both ARM64 and x64 Macs.
from templ.
Related Issues (20)
- Little typo in streaming documentation
- bug: `templ generate --watch --proxy` triggers 2 browser reload events HOT 1
- bug: ambiguous child/string expression grammar HOT 4
- bug: go to definition causes error in Neovim v0.10.x HOT 11
- LSP - gopls command error HOT 3
- bug: ComponentScript rendered even when 'if condition' fails HOT 1
- GoToDef .Templ templ() instead of .go func () HOT 2
- bug(lsp): diagnostics error on Windows due to URI encoding HOT 1
- If you write the class attribute 2 times, the second one is silently discarded HOT 1
- bug: discrepancy between buffers in `runtime.go` and `runtime/bufferpool.go` HOT 3
- `templ generate` is loading my layout into styles.css HOT 5
- documentation: templ.SafeURL is not working as described HOT 8
- Setting children from go code HOT 2
- Neovim/Template goto definition returns error: index out of range HOT 9
- proposal: render individual template fragments
- Taking too much memory with (relatively) larger files HOT 3
- Switch fallthrough not supported
- Suggestion when convert golang template to a-h/templ HOT 4
- Handle Generics for templ ('func') definition HOT 1
- Parser chokes on "<" in if statements HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from templ.