Code Monkey home page Code Monkey logo

Comments (7)

Patrik-Tkacik avatar Patrik-Tkacik commented on June 4, 2024 1

@G0rav Hey, sorry no. Still have the project on hold, I haven't been experimenting with it. have my hands full of work on some other stuff.

from next.js.

Guccifer808 avatar Guccifer808 commented on June 4, 2024

Hey there. Indeed i'm having the same issue with the same template, although I rolled custom internalization the issue stays the same. Imported MDX content doesn't translate (if you try wrap items in t() you get undefined on vercel prod environment, but works fine on my local dev environment. However, doing the same but without t() works just fine. Most likely I'll walk away from mdx in this case.

I'm curious if you made any progress debugging this?

from next.js.

Patrik-Tkacik avatar Patrik-Tkacik commented on June 4, 2024

I’ve put the project on pause as I have no way to track whats wrong effectively. My issue was with static/dynamic paths, I think. Not with mdx files not translating. What alternative will you use @Guccifer808?

from next.js.

Guccifer808 avatar Guccifer808 commented on June 4, 2024

@Patrik-Tkacik I've switched from .mdx to an array of objects works flawlessly.

My issue was with static/dynamic paths, I think. Not with .mdx files not translating

According to my tests .mdx in defined and renders fine in prod, it's the object inside it that returns undefined in prod. Thus, dynamic paths (in my case app/[lang]/) were not an issue. Moreover, all other parts of the app have no issues, only objects inside .mdx

from next.js.

G0rav avatar G0rav commented on June 4, 2024

Hi, any luck with the solution?

It's not working for me as well. Everything works well on local dev but on production, it doesn't loads the content of .mdx file. Moreover, it doesn't produce any error so it is hard to understand what's wrong.

from next.js.

Patrik-Tkacik avatar Patrik-Tkacik commented on June 4, 2024

@Guccifer808 so you made a static array instead of dynamically fetching it?

from next.js.

Guccifer808 avatar Guccifer808 commented on June 4, 2024

@Guccifer808 so you made a static array instead of dynamically fetching it?

I made loader similar to mdxloader just migrated to array of objects:

import { allBrandsData, brandsNames } from '@/data/allBrandsData'

/**

  • Loads brand data based on the provided parameter.
  • @param {string} type - The type of data to load. Can be 'data' for all brand data or 'names' for brand names.
  • @returns {Promise<Array|Object|null>} - Returns the requested data or null if the parameter is invalid.
    */
    export async function loadBrandData(type) {
    try {
    switch (type) {
    case 'data':
    return allBrandsData
    case 'names':
    return brandsNames
    default:
    console.warn(Invalid parameter: ${type}. Expected 'data' or 'names'.)
    return null
    }
    } catch (error) {
    console.error(Error loading brand data: ${error.message})
    throw error
    }
    }

from next.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.