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

[BUG] Cannot import file with same name as game's parent folder #93

Open
ChicknTurtle opened this issue May 17, 2024 · 1 comment
Open

Comments

@ChicknTurtle
Copy link

This issue only occurs when using love.js.
I have a game, with a filetree like this:

game/
├── main.lua
└── game.lua

When I attempt to import game.lua from main.lua...

Game = require 'game'

I get the error:

Error: main.lua:1: module 'game' not found:
love.js:9 	no field package.preload['game']
love.js:9 	no 'game' in LOVE game directories.
love.js:9 	no file 'game' in LOVE paths.
...

However, when I rename my game folder to something else (like src), it works fine.
Took me forever to figure this out, now it's not much of a problem for me.

Here is how I packaged my game:

love.js game .packaged -t game -c
@DocNITE
Copy link

DocNITE commented Jun 1, 2024

@Davidobot

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