Comments (12)
I believe the root cause is the use of filepath.Join in the context of fs.FS
with Windows using forward slash vs back slash. A similar issue was discussed here with the explanation:
The io/fs.FS package uses forward slashes for filenames, even on Windows. See https://golang.org/pkg/io/fs/#ValidPath:
"Note that paths are slash-separated on all systems, even Windows."
You should use path.Join, not filepath.Join for embed filenames.
Originally posted by @eliasnaur in golang/go#44305 (comment)
from buffalo.
Ditto here, same problem.
Environment:
Windows 11 x64
Go 1.20.3
Buffalo 0.18.14
To reproduce
- Create and run test app
$ buffalo new test-app
$ cd test-app
$ buffalo generate resource Items name:string
$ buffalo pop create
$ buffalo pop migrate
$ buffalo dev
-
Navigate to `http://localhost:3000/items/new
-
Observe error as described in @armondressler's report above
from buffalo.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days.
from buffalo.
This is related to how go:embed works. With go embed, files starting with "." and "_" are ignored. Which means, they are not available in the binary.
Check: https://pkg.go.dev/embed
To fix this, you can update the public/embed.go
and apply this change:
- //go:embed */* *
+ //go:embed all:*/* all:*
from buffalo.
@fsniper that is not correct. See my above comment and the linked issues. It is a problem with using filepath.Join
vs path.Join
under Windows.
from buffalo.
@saurori I can't speak for windows, but I had to fix this on OSX just 2 days ago. And this was my solution.
from buffalo.
I suppose my case was totally unrelated. I used a public/partials
directory which does not refer to any action.
from buffalo.
@fsniper what you described with go:embed I also ran into on macOS (has to do with go:embed prior to go 1.18 and files starting with _
). But I believe the issue in this thread and other linked issues has to do with back slash vs forward slash behavior on Windows when using filepath.Join
.
from buffalo.
I am on go version go1.20.4 darwin/amd64. Perhaps there are 2 separate issues at play here.
from buffalo.
I checked the test case and it's working on my configuration. So my situation is unrelated.
from buffalo.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days.
from buffalo.
This issue was closed because it has been stalled for 30+7 days with no activity.
from buffalo.
Related Issues (20)
- feature: Move MIME support out of internal HOT 3
- choir: remove Gorilla Toolkit dependencies
- bug: LogLvl property seems to be ignored HOT 13
- feature: Support Rate Limiting HTTP Requests? HOT 4
- bug: wrong template string in partialFeeder under Windows HOT 5
- Is this project still under development at all? HOT 4
- bug: Middleware.Skip doesn't work for non-POST routes that overlap a Resource HOT 2
- feature: Support for GraphQL HOT 2
- feature: Webpack -> Vite HOT 2
- bug: Add your company takes you to the home page again HOT 2
- Vulnerability of dependency "golang.org/x/net" HOT 2
- bug: i getting a issue while creating migration i use bigint for primary id autoincrement not apply in database table HOT 2
- Difficulties reading raw request body because it's already read HOT 2
- feature: how to open two or many port for app? HOT 4
- How can i remove the "ETag" response header which is set in gobuffalo fileServer ? HOT 4
- invalid go version '1.21.3': must match format 1.23 HOT 4
- I can't cross compile to linux HOT 4
- bug: Generated new app with vcs=none sets the directory is registered as a Git root. HOT 2
- feature: Update Docker Image to Support 1.21.X HOT 5
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 buffalo.