After working for a while, changes to config.tsx no longer regenerates config.js. Tried restarting, stripping down config.tsx, touching config.js, etc. It started working again after I chose Preferences > Edit Oni config (which also help verify that I was editing the right copy of config.tsx.
Can't reproduce anymore.
v0.3.1
Can reproduce again on master (v0.3.2 / 26d015cd074fdc4f02e597725bfef9e433ad3c70).
This time Preferences > Edit Oni config doesn't fix it.
@hboon Can you still reproduce this error on v0.3.4?
@badosu Yes, I can reproduce it in v0.3.4, download from the Releases page.
@hboon Are you sure there are no compilation issues in your config.tsx file?
If backup your current config and start a new one, does the new one not change the configuration?
@badosu Here's what I just tried:
import * as React from "/Applications/Oni.app/Contents/Resources/app/node_modules/react"
import * as Oni from "/Applications/Oni.app/Contents/Resources/app/node_modules/oni-api"
export const activate = (oni: Oni.Plugin.Api) => {
console.log("config activated57")
}
vim.setting.autoread enabled)bdI repeated the above after starting a new Oni window (since most of the config has been removed, this is pretty much a blank slate?) with the same result.
Maybe I missed something obvious?
Are you editing ~/.config/oni/config.tsx?
Yes
I find sometimes that to get the transpilation to work I have to got via the QuickOpen menu to Edit User Config and then make the change in the split and save it.
Indicative of a bug no doubt, but maybe an interim solution?
I just tried that (QuickOpen) and Preferences > Edit Oni Config and while the file is opened, editing it doesn't update config.js.
It's no biggie for now though, I'm not making much changes to my configuration. So if no one else is observing this issue, maybe it's just me.
@hboon can you open Help > Developer Tools before you try to save your config.tsx file and see if it generates any error messages when you save?
It should output the following if successful:

When I move to a tab which has config.tsx open, I see this in the console (set to verbose):

I see something similar (if not exactly the same) when I move to tab with config.js open. When I save config.tsx, nothing else gets logged to the console.
When I save config.js instead, console.log() calls in there get called correctly.
I see different messages if I go to a .swift file or .h. Something about "No language server registered". So it seems to be working otherwise.
At some point I had moved the config files from (I think) ~/.oni/ to ~/.config/.oni/. And the transpiling probably stopped working completely sometime after that. Might be related?
I can reproduce on 0.3.4 from releases and on master as well
So, is there any workaround till fix is in place?
Getting the same issue. The language server also complains it cannot find react and oni-api modules. I am on v0.3.7-beta3.
I figured out the problem at least for me: My ~/.config/oni directory is symlinked to my dotfiles repo. If I remove the symbolic link and copy over my config.tsx it will compile just fine.
EDIT: If only my config.tsx is symlinked, auto-compilation works! Auto-completion seems to fail only when the entire oni config directory is symlinked. I use GNU stow for symlinking files from my dotfiles repo. Stow's behaviour is to symlink the entire oni directory if it did not already exist. Therefore my solution was to remove the symlinked oni directory, start up oni so that it creates the directory again, and run stow which will only symlink the config file.
FWIW, My ~/.config/ is symlink-ed to a folder in my Dropbox.
@hboon My workaround probably won't work for you. The issue still stands that oni fails to compile config.tsx properly when the ~/.config/oni directory (and therefore any of its parent directories) is symlinked.
@Towerism that's good though, a least if it's reproducible, someone can fix it :)
@hboon and @Towerism one option as a workaround is to set an ENV variable in your .bashrc or .zshrc which is $ONI_CONFIG_FILE if the variable is present oni will use that as the path to your config, let me know if that helps at all, will look into getting it to follow symlinks when I (edit: or someonelse) has a chance to look into it get a chance (for reference the issue is somewhere along this path
@Akin909
Neither of this in ~/.profile helped for me:
export ONI_CONFIG_FILE=/Users/hboon/Dropbox/backup/dotconfig/oni/config.tsx
export ONI_CONFIG_FILE=/Users/hboon/Dropbox/backup/dotconfig/oni/config.js
I verified with !echo $ONI_CONFIG_FILE in Oni. Tried on 0.3.2 though. Are you expecting it to work with 0.3.2? (It's been a while, but I can't remember why I tried a few versions after 0.3.2 but stuck to it).
@Akin909 This worked for me: export ONI_CONFIG_FILE=~/.dotfiles/oni/.config/oni/config.tsx.
@hboon I restarted my X11 session to make sure that the environment variable would be picked up by oni.
EDIT: This proved not to be reliable. Went back to my original workaround.