The requested module '../utils/formatTextWithStyles.js' does not provide an export named 'default'

Hey i have a problem with import a function my codes
import formatTextWithStyles from '../utils/formatTextWithStyles.js';
import formatTextWithStyles from '../utils/formatTextWithStyles.js';
and
module.exports = function formatTextWithStyles(text) {
return text
.replace(/<red>/g, '<span class="red">')
.replace(/<\/red>/g, '</span>')
.replace(/<green>/g, '<span class="green">')
.replace(/<\/green>/g, '</span>')
.replace(/<yellow>/g, '<span class="yellow">')
.replace(/<\/yellow>/g, '</span>')
.replace(/<blue>/g, '<span class="blue">')
.replace(/<\/blue>/g, '</span>')
.replace(/<underline>/g, '<span class="underline">')
.replace(/<\/underline>/g, '</span>')
.replace(/<italic>/g, '<span class="italic">')
.replace(/<\/italic>/g, '</span>')
.replace(/<strong>/g, '<strong>')
.replace(/<\/strong>/g, '</strong>');
};
module.exports = function formatTextWithStyles(text) {
return text
.replace(/<red>/g, '<span class="red">')
.replace(/<\/red>/g, '</span>')
.replace(/<green>/g, '<span class="green">')
.replace(/<\/green>/g, '</span>')
.replace(/<yellow>/g, '<span class="yellow">')
.replace(/<\/yellow>/g, '</span>')
.replace(/<blue>/g, '<span class="blue">')
.replace(/<\/blue>/g, '</span>')
.replace(/<underline>/g, '<span class="underline">')
.replace(/<\/underline>/g, '</span>')
.replace(/<italic>/g, '<span class="italic">')
.replace(/<\/italic>/g, '</span>')
.replace(/<strong>/g, '<strong>')
.replace(/<\/strong>/g, '</strong>');
};
4 Replies
d.js toolkit
d.js toolkit2mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
./u.7-z
./u.7-zOP2mo ago
No description
./u.7-z
./u.7-zOP2mo ago
pls help me
Amgelo
Amgelo2mo ago
not a djs issue you're mixing commonjs exports with esm imports either use import/export or module.exports/require not both not sure how that works
Want results from more Discord servers?
Add your server