Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Every opensource plugin is not working from now on. Api importing error. #452

Closed
CodeLit opened this issue Nov 23, 2023 · 2 comments
Closed

Comments

@CodeLit
Copy link

CodeLit commented Nov 23, 2023

Now after the update, plugins stopped working, because the import principle has changed. It is necessary to return backward compatibility for plugins to work.

image

For example, this code is from documentation:

import * as alt from 'alt-server';
import * as Athena from '@AthenaServer/api';

const PLUGIN_NAME = 'myPlugin';
Athena.systems.plugins.registerPlugin(PLUGIN_NAME, () => {
    alt.log('Hello from Athena Server!');
});

is not working, because we need to add index file in the end:

import * as alt from 'alt-server';
import * as Athena from '@AthenaServer/api/index.js';

const PLUGIN_NAME = 'myPlugin';
Athena.systems.plugins.registerPlugin(PLUGIN_NAME, () => {
    alt.log('Hello from Athena Server!');
});

Now code is works, and there is no error anymore.

@Stuyk
Copy link
Owner

Stuyk commented Nov 23, 2023

This is normal behavior. See this post from the alt:V team back in February of 2023.

https://discord.com/channels/371265202378899476/585862696281571341/1079021033199243274

@CodeLit
Copy link
Author

CodeLit commented Nov 23, 2023

I'm closing the issue, but I still think there should be backwards compatibility.

@CodeLit CodeLit closed this as completed Nov 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants