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

ERROR: Unexpected character , (U+002C) before name Even though the mdx is correct #468

Open
Himasnhu-AT opened this issue Jul 10, 2024 · 2 comments

Comments

@Himasnhu-AT
Copy link

Describe the bug

ERROR:

 ⨯ [Error: [next-mdx-remote] error compiling MDX:
Unexpected character `,` (U+002C) before name, expected a character that can start a name, such as a letter, `$`, or `_`

More information: https://mdxjs.com/docs/troubleshooting-mdx] {
  digest: '3948628757'
}
 ⨯ [Error: [next-mdx-remote] error compiling MDX:
Unexpected character `,` (U+002C) before name, expected a character that can start a name, such as a letter, `$`, or `_`

More information: https://mdxjs.com/docs/troubleshooting-mdx] {
  digest: '3948628757'
}

When i using mdx file:

# Step 5: Advanced Features

This step focuses on expanding the functionality of our SQL engine to handle more complex queries and data sources.

## Implementing JOIN Operations

Add support for joining data from multiple tables. You'll need to implement logic to handle different JOIN types (INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN) and specify the join condition based on common columns.

## Adding Aggregation Functions

Implement common aggregation functions like SUM, AVG, COUNT, MIN, and MAX. These functions operate on a group of rows and calculate a single value based on a specific column. You'll need to consider how to handle \`GROUP BY\` clauses, which group rows based on a specific column value.

## Expanding WHERE Clause Capabilities

Extend the \`WHERE\` clause to support more complex conditions, including:

* **Logical operators:** AND, OR, NOT
* **Comparison operators:** >, <, >=, <=, !=
* **String operations:** LIKE, IN, NOT IN

## Handling Different Data Sources

Expand the engine to support various data source types beyond simple JSON files. This could include:

* **CSV files:** Use libraries like \`csv\` to parse CSV data into suitable structures.
* **Database connections:** Use libraries like \`mysql\` or \`sqlite3\` to interact with databases.

## Example: JOIN Operation Implementation

\`\`\`javascript
// Example implementation for joining two tables
function joinTables(table1, table2, joinType, joinCondition) {
  // ... implementation to handle different JOIN types and join conditions
  return joinedTable;
}

// Example usage
const customers = [/* ... customer data */];
const orders = [/* ... order data */];
const joinedData = joinTables(customers, orders, 'INNER JOIN', 'customers.id = orders.customer_id');
\`\`\`

## Example: Aggregation Function Implementation

\`\`\`javascript
// Example implementation for SUM aggregation function
function sum(column, data) {
  let sumValue = 0;
  data.forEach(row => {
    sumValue += row[column];
  });
  return sumValue;
}

// Example usage
const salesData = [/* ... sales data */];
const totalSales = sum('amount', salesData);
\`\`\`

Reproduction

Clone this url: https://github.com/Himasnhu-AT/md-render

next-mdx-remote version

5.0.0

@talatkuyuk
Copy link

It is not related with next-mdx-remote. You have to escape < character in MDX if there is any character adjacent to it other than space.

wrong:
* **Comparison operators:** >, <, >=, <=, !=
do:
* **Comparison operators:** >, \<, >=, \<=, !=

@Himasnhu-AT
Copy link
Author

thanks

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